forked from qt-creator/qt-creator
CppTools: Prioritize project parts from active project
...when selecting one for the editor document. Change-Id: I85066aaa0862870cb2db2fb2cb40c2b2c23b2cac Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -36,10 +36,11 @@ ClangEditorDocumentParser::ClangEditorDocumentParser(const QString &filePath)
|
||||
}
|
||||
|
||||
void ClangEditorDocumentParser::updateHelper(const QFutureInterface<void> &,
|
||||
const CppTools::WorkingCopy &)
|
||||
const CppTools::WorkingCopy &,
|
||||
const ProjectExplorer::Project *activeProject)
|
||||
{
|
||||
State state_ = state();
|
||||
state_.projectPart = determineProjectPart(filePath(), configuration(), state_);
|
||||
state_.projectPart = determineProjectPart(filePath(), configuration(), state_, activeProject);
|
||||
setState(state_);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ public:
|
||||
|
||||
private:
|
||||
void updateHelper(const QFutureInterface<void> &future,
|
||||
const CppTools::WorkingCopy &) override;
|
||||
const CppTools::WorkingCopy &,
|
||||
const ProjectExplorer::Project *activeProject) override;
|
||||
};
|
||||
|
||||
} // namespace ClangCodeModel
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#include <cpptools/cppworkingcopy.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <texteditor/convenience.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
@@ -115,7 +117,12 @@ void ClangEditorDocumentProcessor::run()
|
||||
connect(&m_parserWatcher, &QFutureWatcher<void>::finished,
|
||||
this, &ClangEditorDocumentProcessor::onParserFinished);
|
||||
const CppTools::WorkingCopy workingCopy = CppTools::CppModelManager::instance()->workingCopy();
|
||||
const QFuture<void> future = ::Utils::runAsync(&runParser, parser(), workingCopy);
|
||||
const ProjectExplorer::Project *activeProject
|
||||
= ProjectExplorer::SessionManager::startupProject();
|
||||
const QFuture<void> future = ::Utils::runAsync(&runParser,
|
||||
parser(),
|
||||
workingCopy,
|
||||
activeProject);
|
||||
m_parserWatcher.setFuture(future);
|
||||
|
||||
// Run builtin processor
|
||||
|
||||
Reference in New Issue
Block a user