logic: removed preprocessor only option when indexing CXX source groups
This commit is contained in:
@@ -17,17 +17,12 @@ public:
|
||||
: startIndexing(false)
|
||||
, fullRefreshVisible(false)
|
||||
, fullRefresh(false)
|
||||
, preprocessorOnlyVisible(false)
|
||||
, preprocessorOnly(false)
|
||||
{}
|
||||
|
||||
bool startIndexing;
|
||||
|
||||
bool fullRefreshVisible;
|
||||
bool fullRefresh;
|
||||
|
||||
bool preprocessorOnlyVisible;
|
||||
bool preprocessorOnly;
|
||||
};
|
||||
|
||||
DialogView(StorageAccess* storageAccess);
|
||||
|
||||
@@ -21,9 +21,6 @@ public:
|
||||
const std::set<FilePath>& getIndexedPaths() const;
|
||||
const std::set<FilePath>& getExcludedPath() const;
|
||||
|
||||
virtual bool preprocessorOnly() const = 0;
|
||||
virtual void setPreprocessorOnly(bool preprocessorOnly) = 0;
|
||||
|
||||
private:
|
||||
FilePath m_sourceFilePath;
|
||||
std::set<FilePath> m_indexedPaths;
|
||||
|
||||
@@ -21,7 +21,6 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand)
|
||||
setCompilerFlags(cmd->getCompilerFlags());
|
||||
setSystemHeaderSearchPaths(cmd->getSystemHeaderSearchPaths());
|
||||
setFrameworkSearchhPaths(cmd->getFrameworkSearchPaths());
|
||||
setPreprocessorOnly(cmd->preprocessorOnly());
|
||||
setShouldApplyAnonymousTypedefTransformation(cmd->shouldApplyAnonymousTypedefTransformation());
|
||||
}
|
||||
else if (dynamic_cast<IndexerCommandCxxManual*>(indexerCommand) != NULL)
|
||||
@@ -33,7 +32,6 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand)
|
||||
setCompilerFlags(cmd->getCompilerFlags());
|
||||
setSystemHeaderSearchPaths(cmd->getSystemHeaderSearchPaths());
|
||||
setFrameworkSearchhPaths(cmd->getFrameworkSearchPaths());
|
||||
setPreprocessorOnly(cmd->preprocessorOnly());
|
||||
setShouldApplyAnonymousTypedefTransformation(cmd->shouldApplyAnonymousTypedefTransformation());
|
||||
}
|
||||
else if (dynamic_cast<IndexerCommandJava*>(indexerCommand) != NULL)
|
||||
@@ -65,7 +63,6 @@ std::shared_ptr<IndexerCommand> SharedIndexerCommand::fromShared(const SharedInd
|
||||
indexerCommand.getFrameworkSearchhPaths(),
|
||||
indexerCommand.shouldApplyAnonymousTypedefTransformation()
|
||||
);
|
||||
command->setPreprocessorOnly(indexerCommand.preprocessorOnly());
|
||||
return command;
|
||||
}
|
||||
else if (indexerCommand.getType() == CXX_MANUAL)
|
||||
@@ -80,7 +77,6 @@ std::shared_ptr<IndexerCommand> SharedIndexerCommand::fromShared(const SharedInd
|
||||
indexerCommand.getCompilerFlags(),
|
||||
indexerCommand.shouldApplyAnonymousTypedefTransformation()
|
||||
);
|
||||
command->setPreprocessorOnly(indexerCommand.preprocessorOnly());
|
||||
return command;
|
||||
}
|
||||
else if (indexerCommand.getType() == JAVA)
|
||||
@@ -112,7 +108,6 @@ SharedIndexerCommand::SharedIndexerCommand(SharedMemory::Allocator* allocator)
|
||||
, m_compilerFlags(allocator)
|
||||
, m_systemHeaderSearchPaths(allocator)
|
||||
, m_frameworkSearchPaths(allocator)
|
||||
, m_preprocessorOnly(false)
|
||||
, m_classPaths(allocator)
|
||||
{
|
||||
}
|
||||
@@ -277,16 +272,6 @@ void SharedIndexerCommand::setFrameworkSearchhPaths(const std::vector<FilePath>&
|
||||
}
|
||||
}
|
||||
|
||||
bool SharedIndexerCommand::preprocessorOnly() const
|
||||
{
|
||||
return m_preprocessorOnly;
|
||||
}
|
||||
|
||||
void SharedIndexerCommand::setPreprocessorOnly(bool preprocessorOnly)
|
||||
{
|
||||
m_preprocessorOnly = preprocessorOnly;
|
||||
}
|
||||
|
||||
bool SharedIndexerCommand::shouldApplyAnonymousTypedefTransformation() const
|
||||
{
|
||||
return m_shouldApplyAnonymousTypedefTransformation;
|
||||
|
||||
@@ -41,9 +41,6 @@ public:
|
||||
std::vector<FilePath> getFrameworkSearchhPaths() const;
|
||||
void setFrameworkSearchhPaths(const std::vector<FilePath>& searchPaths);
|
||||
|
||||
bool preprocessorOnly() const;
|
||||
void setPreprocessorOnly(bool preprocessorOnly);
|
||||
|
||||
bool shouldApplyAnonymousTypedefTransformation() const;
|
||||
void setShouldApplyAnonymousTypedefTransformation(bool shouldApplyAnonymousTypedefTransformation);
|
||||
|
||||
@@ -75,7 +72,6 @@ private:
|
||||
SharedMemory::Vector<SharedMemory::String> m_compilerFlags;
|
||||
SharedMemory::Vector<SharedMemory::String> m_systemHeaderSearchPaths;
|
||||
SharedMemory::Vector<SharedMemory::String> m_frameworkSearchPaths;
|
||||
bool m_preprocessorOnly;
|
||||
bool m_shouldApplyAnonymousTypedefTransformation;
|
||||
|
||||
// java
|
||||
|
||||
@@ -372,7 +372,6 @@ bool Project::requestIndex(bool forceRefresh, bool needsFullRefresh)
|
||||
}
|
||||
|
||||
bool fullRefresh = forceRefresh | needsFullRefresh;
|
||||
bool preprocessorOnly = false;
|
||||
|
||||
if (Application::getInstance()->hasGUI())
|
||||
{
|
||||
@@ -380,9 +379,6 @@ bool Project::requestIndex(bool forceRefresh, bool needsFullRefresh)
|
||||
options.fullRefreshVisible = !needsFullRefresh;
|
||||
options.fullRefresh = forceRefresh;
|
||||
|
||||
options.preprocessorOnlyVisible = hasCxxSourceGroup();
|
||||
options.preprocessorOnly = false;
|
||||
|
||||
Application::getInstance()->getDialogView()->hideUnknownProgressDialog();
|
||||
|
||||
options = Application::getInstance()->getDialogView()->startIndexingDialog(
|
||||
@@ -394,7 +390,6 @@ bool Project::requestIndex(bool forceRefresh, bool needsFullRefresh)
|
||||
}
|
||||
|
||||
fullRefresh = options.fullRefresh | needsFullRefresh;
|
||||
preprocessorOnly = options.preprocessorOnly;
|
||||
}
|
||||
|
||||
if (fullRefresh)
|
||||
@@ -411,13 +406,13 @@ bool Project::requestIndex(bool forceRefresh, bool needsFullRefresh)
|
||||
|
||||
MessageStatus((fullRefresh ? "Reindexing Project" : "Refreshing Project"), false, true).dispatch();
|
||||
|
||||
buildIndex(filesToIndex, filesToClean, fullRefresh, preprocessorOnly);
|
||||
buildIndex(filesToIndex, filesToClean, fullRefresh);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Project::buildIndex(
|
||||
const std::set<FilePath>& filesToIndex, const std::set<FilePath>& filesToClean, bool fullRefresh, bool preprocessorOnly)
|
||||
const std::set<FilePath>& filesToIndex, const std::set<FilePath>& filesToClean, bool fullRefresh)
|
||||
{
|
||||
MessageClearErrorCount().dispatch();
|
||||
if (fullRefresh)
|
||||
@@ -444,7 +439,6 @@ void Project::buildIndex(
|
||||
{
|
||||
for (std::shared_ptr<IndexerCommand> command: sourceGroup->getIndexerCommands(&filesToIndexTemp, fullRefresh))
|
||||
{
|
||||
command->setPreprocessorOnly(preprocessorOnly);
|
||||
indexerCommandList->addCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,11 +47,7 @@ public: // todo: make private again
|
||||
private:
|
||||
bool requestIndex(bool forceRefresh, bool needsFullRefresh);
|
||||
|
||||
void buildIndex(
|
||||
const std::set<FilePath>& filesToIndex,
|
||||
const std::set<FilePath>& filesToClean,
|
||||
bool fullRefresh,
|
||||
bool preprocessorOnly);
|
||||
void buildIndex(const std::set<FilePath>& filesToIndex, const std::set<FilePath>& filesToClean, bool fullRefresh);
|
||||
|
||||
bool hasCxxSourceGroup() const;
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ IndexerCommandCxx::IndexerCommandCxx(
|
||||
, m_frameworkSearchPaths(frameworkSearchPaths)
|
||||
, m_compilerFlags(compilerFlags)
|
||||
, m_shouldApplyAnonymousTypedefTransformation(shouldApplyAnonymousTypedefTransformation)
|
||||
, m_preprocessorOnly(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -59,16 +58,6 @@ std::vector<std::string> IndexerCommandCxx::getCompilerFlags() const
|
||||
return m_compilerFlags;
|
||||
}
|
||||
|
||||
bool IndexerCommandCxx::preprocessorOnly() const
|
||||
{
|
||||
return m_preprocessorOnly;
|
||||
}
|
||||
|
||||
void IndexerCommandCxx::setPreprocessorOnly(bool preprocessorOnly)
|
||||
{
|
||||
m_preprocessorOnly = preprocessorOnly;
|
||||
}
|
||||
|
||||
bool IndexerCommandCxx::shouldApplyAnonymousTypedefTransformation() const
|
||||
{
|
||||
return m_shouldApplyAnonymousTypedefTransformation;
|
||||
|
||||
@@ -28,9 +28,6 @@ public:
|
||||
std::vector<FilePath> getFrameworkSearchPaths() const;
|
||||
std::vector<std::string> getCompilerFlags() const;
|
||||
|
||||
bool preprocessorOnly() const override;
|
||||
void setPreprocessorOnly(bool preprocessorOnly) override;
|
||||
|
||||
bool shouldApplyAnonymousTypedefTransformation() const;
|
||||
|
||||
private:
|
||||
@@ -38,8 +35,6 @@ private:
|
||||
std::vector<FilePath> m_frameworkSearchPaths;
|
||||
std::vector<std::string> m_compilerFlags;
|
||||
bool m_shouldApplyAnonymousTypedefTransformation;
|
||||
|
||||
bool m_preprocessorOnly;
|
||||
};
|
||||
|
||||
#endif // INDEXER_COMMAND_CXXL_H
|
||||
|
||||
@@ -40,7 +40,7 @@ std::shared_ptr<IntermediateStorage> IndexerCxx<IndexerCommandType, ParserType>:
|
||||
|
||||
parserClient->resetStorage();
|
||||
|
||||
if (parserClient->hasFatalErrors() || indexerCommand->preprocessorOnly())
|
||||
if (parserClient->hasFatalErrors())
|
||||
{
|
||||
storage->setAllFilesIncomplete();
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ void CxxParser::buildIndex(std::shared_ptr<IndexerCommandCxxCdb> indexerCommand)
|
||||
std::shared_ptr<CxxDiagnosticConsumer> diagnostics = getDiagnostics(canonicalFilePathCache, true);
|
||||
tool.setDiagnosticConsumer(diagnostics.get());
|
||||
|
||||
ASTActionFactory actionFactory(m_client, m_fileRegister, canonicalFilePathCache, indexerCommand->preprocessorOnly());
|
||||
ASTActionFactory actionFactory(m_client, m_fileRegister, canonicalFilePathCache, false);
|
||||
tool.run(&actionFactory);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void CxxParser::buildIndex(std::shared_ptr<IndexerCommandCxxManual> indexerComma
|
||||
std::shared_ptr<CxxDiagnosticConsumer> diagnostics = getDiagnostics(canonicalFilePathCache, true);
|
||||
tool.setDiagnosticConsumer(diagnostics.get());
|
||||
|
||||
ASTActionFactory actionFactory(m_client, m_fileRegister, canonicalFilePathCache, indexerCommand->preprocessorOnly());
|
||||
ASTActionFactory actionFactory(m_client, m_fileRegister, canonicalFilePathCache, false);
|
||||
tool.run(&actionFactory);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ QtIndexingDialog::QtIndexingDialog(QWidget* parent)
|
||||
, m_filePathLabel(nullptr)
|
||||
, m_errorLabel(nullptr)
|
||||
, m_fullRefreshCheckBox(nullptr)
|
||||
, m_preprocessorOnlyCheckBox(nullptr)
|
||||
, m_sizeHint(QSize(450, 450))
|
||||
, m_callback([](DialogView::IndexingOptions){})
|
||||
{
|
||||
@@ -89,27 +88,7 @@ void QtIndexingDialog::setupStart(
|
||||
indexLabel->hide();
|
||||
}
|
||||
|
||||
if (options.preprocessorOnlyVisible)
|
||||
{
|
||||
m_preprocessorOnlyCheckBox = new QCheckBox("C/C++ preprocessor only", this);
|
||||
m_preprocessorOnlyCheckBox->setObjectName("message");
|
||||
m_preprocessorOnlyCheckBox->setChecked(options.preprocessorOnly);
|
||||
|
||||
QtHelpButton* button = new QtHelpButton(
|
||||
"Run only the C/C++ preprocessor on the files. This will quickly show include errors and help fix problems "
|
||||
"in the project setup faster.\n\nThe files will not be indexed and show up as incomplete.");
|
||||
button->setColor(Qt::white);
|
||||
|
||||
QHBoxLayout* subLayout = new QHBoxLayout();
|
||||
subLayout->addStretch();
|
||||
subLayout->addWidget(m_preprocessorOnlyCheckBox);
|
||||
subLayout->addSpacing(10);
|
||||
subLayout->addWidget(button);
|
||||
|
||||
layout->addLayout(subLayout);
|
||||
}
|
||||
|
||||
if (m_fullRefreshCheckBox || m_preprocessorOnlyCheckBox)
|
||||
if (m_fullRefreshCheckBox)
|
||||
{
|
||||
layout->addSpacing(20);
|
||||
}
|
||||
@@ -304,7 +283,6 @@ void QtIndexingDialog::handleNext()
|
||||
DialogView::IndexingOptions options;
|
||||
options.startIndexing = true;
|
||||
options.fullRefresh = m_fullRefreshCheckBox && m_fullRefreshCheckBox->isChecked();
|
||||
options.preprocessorOnly = m_preprocessorOnlyCheckBox && m_preprocessorOnlyCheckBox->isChecked();
|
||||
m_callback(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ private:
|
||||
|
||||
// start indexing
|
||||
QCheckBox* m_fullRefreshCheckBox;
|
||||
QCheckBox* m_preprocessorOnlyCheckBox;
|
||||
|
||||
QSize m_sizeHint;
|
||||
|
||||
|
||||
@@ -41,12 +41,3 @@ std::vector<FilePath> IndexerCommandJava::getClassPath() const
|
||||
{
|
||||
return m_classPath;
|
||||
}
|
||||
|
||||
bool IndexerCommandJava::preprocessorOnly() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void IndexerCommandJava::setPreprocessorOnly(bool preprocessorOnly)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,9 +25,6 @@ public:
|
||||
|
||||
std::vector<FilePath> getClassPath() const;
|
||||
|
||||
bool preprocessorOnly() const override;
|
||||
void setPreprocessorOnly(bool preprocessorOnly) override;
|
||||
|
||||
private:
|
||||
std::vector<FilePath> m_classPath;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ std::shared_ptr<IntermediateStorage> IndexerJava::doIndex(
|
||||
|
||||
parserClient->resetStorage();
|
||||
|
||||
if (parserClient->hasFatalErrors() || indexerCommand->preprocessorOnly())
|
||||
if (parserClient->hasFatalErrors())
|
||||
{
|
||||
storage->setAllFilesIncomplete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user