qmljs: new import/dep tracking

Change-Id: I9f4de2a06aad3afb80372a4b80e56db658683575
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Fawzi Mohamed
2013-10-16 15:08:27 +02:00
parent 5bf3ed7c6a
commit e1b44e870f
24 changed files with 1327 additions and 32 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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: