forked from qt-creator/qt-creator
qmljs: add infrastructure handling qml dialects better
QmlBundles enables us to treat the different qml dialects differently. Add imports completion. Change-log: [Qml/JS Support] Corrected handling of QtQuick2 only features. Change-log: [Qml/JS Support] Added import completion in editor. Task-number: QTCREATORBUG-8750 Task-number: QTCREATORBUG-8624 Task-number: QTCREATORBUG-8584 Task-number: QTCREATORBUG-8583 Task-number: QTCREATORBUG-8429 Change-Id: I1384b1b23136a85b4d077895ea86f92960da9e71 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <qmljstools/qmljsmodelmanager.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
@@ -184,32 +185,10 @@ void QmlProject::refresh(RefreshOptions options)
|
||||
if (options & Files)
|
||||
m_rootNode->refresh();
|
||||
|
||||
QmlJS::ModelManagerInterface::ProjectInfo projectInfo(this);
|
||||
projectInfo.sourceFiles = files();
|
||||
QmlJS::ModelManagerInterface::ProjectInfo projectInfo =
|
||||
QmlJSTools::defaultProjectInfoForProject(this);
|
||||
projectInfo.importPaths = customImportPaths();
|
||||
|
||||
QtSupport::BaseQtVersion *qtVersion = 0;
|
||||
{
|
||||
ProjectExplorer::Target *target = activeTarget();
|
||||
ProjectExplorer::Kit *kit = target ? target->kit() : ProjectExplorer::KitManager::instance()->defaultKit();
|
||||
ProjectExplorer::ToolChain *toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(kit);
|
||||
qtVersion = QtSupport::QtKitInformation::qtVersion(kit);
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, qtVersion, toolChain, false,
|
||||
&projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
|
||||
}
|
||||
|
||||
if (qtVersion) {
|
||||
projectInfo.tryQmlDump = true;
|
||||
projectInfo.qtImportsPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
|
||||
projectInfo.qtQmlPath = qtVersion->qmakeProperty("QT_INSTALL_QML");
|
||||
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
||||
|
||||
if (!projectInfo.qtQmlPath.isEmpty())
|
||||
projectInfo.importPaths += projectInfo.qtQmlPath;
|
||||
if (!projectInfo.qtImportsPath.isEmpty())
|
||||
projectInfo.importPaths += projectInfo.qtImportsPath;
|
||||
|
||||
}
|
||||
m_modelManager->updateProjectInfo(projectInfo);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user