From 08163f3b9ae4692cc7f2b4b6fe6e7aa3b9f6c626 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 11 Apr 2014 23:07:52 +0200 Subject: qmljs: better defaults, more uniform handling of paths Uniform handling of the different qml dialects. Now paths for a given document prefer the project of that document. For Qt the following sequence is used: - Qt of the project of the document - Qt of the active target - Qt used to run creator Currently all paths of the open projects are still merged, but that can be changed. Change-Id: Iacf28d63184c05e2bcdfe0210ec472d2bf140d66 Reviewed-by: Thomas Hartmann --- src/libs/qmljs/qmljsmodelmanagerinterface.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.h') diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index 0dc2cb7142..e8b4748932 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -177,7 +177,7 @@ public: void updateLibraryInfo(const QString &path, const QmlJS::LibraryInfo &info); void emitDocumentChangedOnDisk(QmlJS::Document::Ptr doc); void updateQrcFile(const QString &path); - ProjectInfo projectInfoForPath(QString path); + ProjectInfo projectInfoForPath(QString path) const; QStringList importPaths() const; QmlJS::QmlLanguageBundles activeBundles() const; @@ -188,17 +188,16 @@ public: CppDataHash cppData() const; LibraryInfo builtins(const Document::Ptr &doc) const; - virtual ViewerContext completeVContext(const ViewerContext &vCtx, - const Document::Ptr &doc = Document::Ptr(0)) const; - virtual ViewerContext defaultVContext(bool autoComplete = true, - const Document::Ptr &doc = Document::Ptr(0)) const; - virtual void setDefaultVContext(const ViewerContext &vContext); + ViewerContext completeVContext(const ViewerContext &vCtx, + const Document::Ptr &doc = Document::Ptr(0)) const; + ViewerContext defaultVContext(Language::Enum language = Language::Qml, + const Document::Ptr &doc = Document::Ptr(0), + bool autoComplete = true) const; + void setDefaultVContext(const ViewerContext &vContext); + virtual ProjectInfo defaultProjectInfo() const; // Blocks until all parsing threads are done. Used for testing. void joinAllThreads(); - - virtual ModelManagerInterface::ProjectInfo defaultProjectInfo() const; - public slots: virtual void resetCodeModel(); void removeProjectInfo(ProjectExplorer::Project *project); @@ -256,7 +255,7 @@ private: QStringList m_defaultImportPaths; QmlJS::QmlLanguageBundles m_activeBundles; QmlJS::QmlLanguageBundles m_extendedBundles; - QmlJS::ViewerContext m_vContext; + QHash m_defaultVContexts; bool m_shouldScanImports; QSet m_scannedPaths; -- cgit v1.2.1 From 8b8c5e8fe87ad1630f7ec2024b86e1369ca9fec9 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Tue, 29 Apr 2014 16:39:16 +0200 Subject: qmljs: ensure that opening an editor always updates the modelmanager Change-Id: Ia23d9c84240bd2c54b0c331494474d0fa74674e8 Reviewed-by: Thomas Hartmann --- src/libs/qmljs/qmljsmodelmanagerinterface.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.h') diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index e8b4748932..425f7bc2eb 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); -- cgit v1.2.1 From 329b1535c806bb09abfa2eedb3724a959619540d Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Wed, 7 May 2014 10:44:15 +0200 Subject: Revert "qmljs: better defaults, more uniform handling of paths" moving to master This reverts commit 0c46692244def9edb89c2914b9b1e5eff10cb6ce Change-Id: Ie09f6db02058f4a5539221f1a0cc4f9225f38300 Reviewed-by: Eike Ziller --- src/libs/qmljs/qmljsmodelmanagerinterface.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.h') diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index 425f7bc2eb..fd28b27a88 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -178,7 +178,7 @@ public: void updateLibraryInfo(const QString &path, const QmlJS::LibraryInfo &info); void emitDocumentChangedOnDisk(QmlJS::Document::Ptr doc); void updateQrcFile(const QString &path); - ProjectInfo projectInfoForPath(QString path) const; + ProjectInfo projectInfoForPath(QString path); QStringList importPaths() const; QmlJS::QmlLanguageBundles activeBundles() const; @@ -189,16 +189,17 @@ public: CppDataHash cppData() const; LibraryInfo builtins(const Document::Ptr &doc) const; - ViewerContext completeVContext(const ViewerContext &vCtx, - const Document::Ptr &doc = Document::Ptr(0)) const; - ViewerContext defaultVContext(Language::Enum language = Language::Qml, - const Document::Ptr &doc = Document::Ptr(0), - bool autoComplete = true) const; - void setDefaultVContext(const ViewerContext &vContext); - virtual ProjectInfo defaultProjectInfo() const; + virtual ViewerContext completeVContext(const ViewerContext &vCtx, + const Document::Ptr &doc = Document::Ptr(0)) const; + virtual ViewerContext defaultVContext(bool autoComplete = true, + const Document::Ptr &doc = Document::Ptr(0)) const; + virtual void setDefaultVContext(const ViewerContext &vContext); // Blocks until all parsing threads are done. Used for testing. void joinAllThreads(); + + virtual ModelManagerInterface::ProjectInfo defaultProjectInfo() const; + public slots: virtual void resetCodeModel(); void removeProjectInfo(ProjectExplorer::Project *project); @@ -256,7 +257,7 @@ private: QStringList m_defaultImportPaths; QmlJS::QmlLanguageBundles m_activeBundles; QmlJS::QmlLanguageBundles m_extendedBundles; - QHash m_defaultVContexts; + QmlJS::ViewerContext m_vContext; bool m_shouldScanImports; QSet m_scannedPaths; -- cgit v1.2.1