diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 09195018d97..3942a240541 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -189,6 +189,14 @@ ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopy() return WorkingCopy(); } +void ModelManagerInterface::activateScan() +{ + if (!m_shouldScanImports) { + m_shouldScanImports = true; + updateImportPaths(); + } +} + QHash ModelManagerInterface::languageForSuffix() const { return defaultLanguageMapping(); diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index e8b4748932f..425f7bc2eb1 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -156,6 +156,7 @@ public: QmlJS::Snapshot snapshot() const; QmlJS::Snapshot newestSnapshot() const; + void activateScan(); void updateSourceFiles(const QStringList &files, bool emitDocumentOnDiskChanged); void fileChangedOnDisk(const QString &path); diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 4afa47a2f41..1b2c3ff1375 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -139,6 +139,8 @@ void QmlJSTextEditorWidget::ctor() m_modelManager = QmlJS::ModelManagerInterface::instance(); m_contextPane = ExtensionSystem::PluginManager::getObject(); + m_modelManager->activateScan(); + m_contextPaneTimer = new QTimer(this); m_contextPaneTimer->setInterval(UPDATE_OUTLINE_INTERVAL); m_contextPaneTimer->setSingleShot(true); diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 4f2e07d96f0..f9bb39e3190 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -448,6 +448,8 @@ QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *pare m_updateOutlineModelTimer.setInterval(UPDATE_OUTLINE_INTERVAL); m_updateOutlineModelTimer.setSingleShot(true); connect(&m_updateOutlineModelTimer, SIGNAL(timeout()), this, SLOT(updateOutlineModel())); + + modelManager->updateSourceFiles(QStringList(parent->filePath()), false); } QmlJSEditorDocumentPrivate::~QmlJSEditorDocumentPrivate()