diff options
author | Miikka Heikkinen <[email protected]> | 2020-05-20 12:47:09 +0300 |
---|---|---|
committer | Miikka Heikkinen <[email protected]> | 2020-06-11 12:42:20 +0000 |
commit | 7f4bf437dac692cd4bdd55fa3de06367b9eb8712 (patch) | |
tree | 149974ca5706ad8267dc5f8bb15e13a2a18c7da6 /src/libs/qmljs/qmljsmodelmanagerinterface.h | |
parent | 346b28f5f9dc0aa70809e1696a970012e3acb94e (diff) |
QmlJS: Add a way to return just the context of the project of a file
Added ModelManagerInterface::projectVContext() method to return just
the context of the project the file belongs to and nothing more.
To make this possible, fixed caching the file-to-project relationships
and removed automatically adding the currently active project to
list of projects the file belongs to in allProjectInfos().
Task-number: QDS-1495
Change-Id: I949c0202d0280264b6856562a2e7abc2f93d13c0
Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.h')
-rw-r--r-- | src/libs/qmljs/qmljsmodelmanagerinterface.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index 8e8b9d2a24c..088b4e593c4 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -174,6 +174,8 @@ public: ViewerContext defaultVContext(Dialect language = Dialect::Qml, const Document::Ptr &doc = Document::Ptr(nullptr), bool autoComplete = true) const; + ViewerContext projectVContext(Dialect language, const Document::Ptr &doc) const; + void setDefaultVContext(const ViewerContext &vContext); virtual ProjectInfo defaultProjectInfo() const; virtual ProjectInfo defaultProjectInfoForProject(ProjectExplorer::Project *project) const; @@ -241,6 +243,7 @@ private: void iterateQrcFiles(ProjectExplorer::Project *project, QrcResourceSelector resources, const std::function<void(Utils::QrcParser::ConstPtr)> &callback); + ViewerContext getVContext(const ViewerContext &vCtx, const Document::Ptr &doc, bool limitToProject) const; mutable QMutex m_mutex; QmlJS::Snapshot m_validSnapshot; |