forked from qt-creator/qt-creator
qmljs: new import/dep tracking
Change-Id: I9f4de2a06aad3afb80372a4b80e56db658683575 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -831,7 +831,7 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
|
||||
|
||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
|
||||
Link link(snapshot, modelManager->importPaths(), modelManager->builtins(doc));
|
||||
Link link(snapshot, modelManager->defaultVContext(), modelManager->builtins(doc));
|
||||
ContextPtr context = link();
|
||||
|
||||
ScopeChain scopeChain(doc, context);
|
||||
|
||||
@@ -122,7 +122,7 @@ QmlJSTools::SemanticInfo SemanticInfoUpdater::makeNewSemanticInfo(const QmlJS::D
|
||||
|
||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||
|
||||
Link link(semanticInfo.snapshot, modelManager->importPaths(), modelManager->builtins(doc));
|
||||
Link link(semanticInfo.snapshot, modelManager->defaultVContext(), modelManager->builtins(doc));
|
||||
semanticInfo.context = link(doc, &semanticInfo.semanticMessages);
|
||||
|
||||
ScopeChain *scopeChain = new ScopeChain(doc, semanticInfo.context);
|
||||
|
||||
@@ -92,13 +92,13 @@ static QList<ProjectExplorer::Task> convertToTasks(const QList<StaticAnalysis::M
|
||||
void QmlTaskManager::collectMessages(
|
||||
QFutureInterface<FileErrorMessages> &future,
|
||||
Snapshot snapshot, QList<ModelManagerInterface::ProjectInfo> projectInfos,
|
||||
QStringList importPaths, bool updateSemantic)
|
||||
ViewerContext vContext, bool updateSemantic)
|
||||
{
|
||||
foreach (const ModelManagerInterface::ProjectInfo &info, projectInfos) {
|
||||
QHash<QString, QList<DiagnosticMessage> > linkMessages;
|
||||
ContextPtr context;
|
||||
if (updateSemantic) {
|
||||
Link link(snapshot, importPaths, snapshot.libraryInfo(info.qtImportsPath));
|
||||
Link link(snapshot, vContext, snapshot.libraryInfo(info.qtImportsPath));
|
||||
context = link(&linkMessages);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ void QmlTaskManager::updateMessagesNow(bool updateSemantic)
|
||||
QFuture<FileErrorMessages> future =
|
||||
QtConcurrent::run<FileErrorMessages>(
|
||||
&collectMessages, modelManager->newestSnapshot(), modelManager->projectInfos(),
|
||||
modelManager->importPaths(), updateSemantic);
|
||||
modelManager->defaultVContext(), updateSemantic);
|
||||
m_messageCollector.setFuture(future);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ private:
|
||||
static void collectMessages(QFutureInterface<FileErrorMessages> &future,
|
||||
QmlJS::Snapshot snapshot,
|
||||
QList<QmlJS::ModelManagerInterface::ProjectInfo> projectInfos,
|
||||
QStringList importPaths,
|
||||
QmlJS::ViewerContext vContext,
|
||||
bool updateSemantic);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user