summaryrefslogtreecommitdiff
path: root/src/plugins/qmljstools/qmljsmodelmanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-4/+5
| | | | | | | | | | | | | | | ... out of SessionManager. The idea is to later move SessionManager into the Core plugin, which both is sensible conceptually and also prerequisite to merge the Bookmark plugin into TextEditor plugin. Currently, only the interface is split, as the load/save implemetations are non-mechanical to disentangle. Change-Id: I31631db3094ea192825a2ccaa6add6188662940b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Remove unneeded includes of utils/runextensions.hJarek Kobus2023-01-271-2/+1
| | | | | | | BTW, spotted some other unused includes marked with yellow. Change-Id: I364e4b6fae73a2be2cfd3a63c1100be4a91aa49a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Use an enum indication the possible abort of an dir iterationhjk2023-01-261-1/+1
| | | | | | | | The bool is not really clear. Change-Id: I4ce6412736aec6b1853fd53d4e535ad045748350 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlJS: std::set instead of QListThomas Hartmann2022-11-231-1/+1
| | | | | | | | | This reduces the CPU time of Export::visibleInVContext() from 50% to 15% on Windows, when switching files. Change-Id: Iff82924c47d1b696c9d3d7ca40f49d9d02bcb3e6 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Merge remote-tracking branch 'origin/9.0' into qds/devTim Jenssen2022-11-091-2/+31
|\ | | | | | | Change-Id: I02fd6f492c27d85b88af7ec8bc18ff62f2c6ed14
| * QmlJS: Fix Follow under cursorMarcus Tillmanns2022-11-081-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to jump to a symbol in a qml file the Qml Model may find the location in a generated .qml file in the build folder. QtCreator searches in all generated .qrc files to try and find the source file so it can jump to it instead. Previously not all auto-generated ".rcc" folders would be found as only the folders of targets (executables) were searched. Plugins or Static Libraries were not searched. With this fix, all projects nodes are searched for the ".rcc" folder and therefore also finds them for Dynamic / Static libraries and plugins. Fixes: QTCREATORBUG-27173 Change-Id: Ic51ac8fbc82c15785cbefd76787942a512ecf3db Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/9.0'Orgad Shaneh2022-10-191-1/+1
|\ \ | |/ | | | | Change-Id: I5e6cfc111941f9609285e1b802121644fa8cdaac
| * Utils: Rename FilePath::relativePath() to relativePathFrom()hjk2022-10-181-1/+1
| | | | | | | | | | | | | | Hopefully less confusion about the direction. Change-Id: I61727d6c4d19e0dfe46f24ff24f5d90f9835d05c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Automatic qmlls support (experimental)Fawzi Mohamed2022-10-121-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks for qmlls (the qml language server of Qt) and if available and set in the preferences uses it instead of the embedded code model for the supported features. Its usage is driven by two flags that can be set in the QtQuick > QML/JS Editing preferences: "use qmlls" activates the use of qmlls if available; "use latest qmlls" always uses the qmlls of the latest Qt, instead of the one of the target (with the one used to compile QtCreator as fallback). To support disabling/enabling of qmlls as soon as one changes the preferences the singleton QmllsSettingsManager can emit a signal on changes. It also keeps track of the latest qmlls binary known. QmlJS::ModelmanagerInterface::ProjectInfo is also extended to keep track of the qmlls binary. QmlJSEditorDocument uses the ProjectInfo and QmllsSettingsManager to decide if a LanguageClient::Client should be started for that document. The client uses the QmllsClient subclass to keep track of the path of the qmlls clients and use the same qmlls process or all files that use the same binary. Currently qmlls <6.4.0 are not considered because they might have too many issues. The enabling/disabling of warnings and highlight is a bit cumbersome because they are handled together in the semantic highlighter, but must be handled separately depending on the qmlls capabilities. The disabling is done at the latest moment stopping the visualization of the embedded model warnings/highlights/suggestions. The computation of the semantic info is not suppressed to support the other features (find usages, semantic highlighting if active,...). When qmlls supports more features a complete removal of the semantic info construction could be evaluated. Change-Id: I3487e1680841025cabba6b339fbfe820ef83f858 Reviewed-by: David Schulz <david.schulz@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* qmljs: (QString -> Utils::FilePath)++Fawzi Mohamed2022-07-131-27/+26
| | | | | | | | | convert more QString containing paths to Utils::FilePath Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QMLPlugins: Remove foreach / Q_FOREACH usageArtem Sokolovskii2022-06-011-9/+17
| | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: Ie3e3ec9fdaea856943e5325cabd21e52bf290e70 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Mimetypes: Make implementation switchable between new and oldEike Ziller2022-02-251-1/+1
| | | | | | | | | | | | | | | | | | - configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in utils/mimetypes2/ - added utils/mimeutils.h header for the Qt Creator specific static wrappers, that also includes the "public" headers for MimeType et al from the new or old implementation, depending on configuration - change all utils/mimetypes/ includes to utils/mimeutils.h - move the implementation for the wrappers to utils/mimetypes(2)/mimeutils.cpp - also move the MimeDatabase declaration in the "old" implementation back to utils/mimetypes/mimedatabase.h Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* qmljs: fix scan out of build dirFawzi Mohamed2022-02-111-8/+41
| | | | | | | | Scan outside the build directory was possible on mac and windows. Avoid it by checking the relative path to the build directory. Change-Id: I6a7082998429f902745146446bf89fc0cc75ca54 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Rename QtSupport::BaseQtVersion to QtVersionhjk2022-01-241-2/+2
| | | | | | | | | | ... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid conflicts. Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qmljsmodelmanager: Add additional directories to find qmltypesMaximilian Goldstein2021-12-071-0/+11
| | | | | | | | | | | | | | This works around the issue that we only looked for qmltypes in the directory the binary ends up being stored in. This did not work for macOS and Windows as those are stored in subdirectories due the platform specific ways binaries are stored there. Now we also look in the directory where the qmltypes should be located on these platforms. Task-number: QTCREATORBUG-24987 Change-Id: I23d46e68f8fad0b4e2e8a01fc7c41360f1e6961e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlJS: Proliferate FilePath and QtcProcess use in QmlJSPluginDumperhjk2021-10-271-4/+4
| | | | | Change-Id: Ie483bb2e9b5d812d380470949564a6bc57801fa9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-3/+3
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* baseqtversion: commands are FilePathesTim Jenssen2021-07-141-1/+1
| | | | | | | | also renamed the qmlscene* qmlRuntime* Change-Id: Ifd522e21f5ce30aaa54060fdcebee2cd8b9463c4 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlJSTools: Guard against null pointer accessv5.0.0-beta1Robert Löhning2021-07-071-1/+1
| | | | | | | Fixes: QTCREATORBUG-25943 Change-Id: If9e6528b0dc5642dbd150e7d20aeb9347f3d4465 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
* QtSupport: Use FilePath for several BaseQtVersion membershjk2021-07-011-1/+1
| | | | | | | | | | uicCommand(), designerCommand(), linguistCommand(), qscxmlcCommand(), qmlsceneCommand(), qmlplugindumpCommand(). No change in functionality intented. Change-Id: I43121de559019f96c2c1ff3b423974dddfc37124 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* MimeDatabase: add FilePath convenience functionDavid Schulz2021-06-231-1/+1
| | | | | Change-Id: I59c825490b3b5c49f3c177584ea4cc885c4f920b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core: Add a default parameter to various ICore::*path functionshjk2021-04-271-1/+1
| | | | | | | | Saves some code on the user side. Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ICore: Change some path API to use FilePathEike Ziller2021-04-261-3/+3
| | | | | | Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Simplify handling of qmlplugindumpKai Köhne2021-03-231-16/+6
| | | | | | | | | | | | | | | | Much of it isn't needed anymore: - we do not build a debug version of qmlplugindump anymore since Qt 5.0 - on mac, qmlplugindump is not an app bundle since Qt 5.1 - since commit 6871f31b4ec6, the env parameter was just passed through So if we take out this and all the infrastructure around it, qmlplugindump is just a tool that we can handle like all the other tools. Change-Id: Ifa583ce7052a9030858312ab7c2e20f7ebce4051 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* MCU: Do not add fall-back path for QUL kitsErik Verbruggen2021-02-161-1/+1
| | | | | | Fixes: UL-3609 Change-Id: I9912c7476f3b45346835d60be61fed7399046162 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Use new, more evocative MessageManager APIEike Ziller2020-12-161-1/+1
| | | | | | | At various places where semantics doesn't change. Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447 Reviewed-by: hjk <hjk@qt.io>
* QmlJSTools: Remove unused includeChristian Stenger2020-07-201-1/+0
| | | | | Change-Id: I4bc61fdebd9b2c20497e7569cdb5f5000317f22d Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Remove Target::applicationTargets()hjk2020-03-251-1/+3
| | | | | | | That's BuildSystem::applicationTargets() nowadays. Change-Id: I01cf0a491e4cb289af08f529fd15c85bfcdf5493 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlJS: Scan app.qmltypes and lib.qmltypes for type informationUlf Hermann2019-10-311-0/+8
| | | | | | | | | | | | | | app.qmltypes is being added as a new convention to Qt 5.15. These files are to be found next to application binaries, and contain the QML types those application register themselves, in contrast to QML types registered from plugins loaded via the regular import mechanism. lib.qmltypes works the same way, in principle, for libraries. This change only adds it to the possible names for qmltypes files, though. Change-Id: I1d7c5835c8c3e988d214c5cdb949ca677b48dfc5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* QmlJS: Clean up qmljsmodelmanagerinterface.{h|cpp}Ulf Hermann2019-10-291-5/+8
| | | | | | | Avoid foreach, fix linter warnings, simplify types, apply coding style. Change-Id: I7cec65e775ee14ce60e1e57077e917285d58c152 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* QmlJSTools: make setupProjectInfoQmlBundles privateUlf Hermann2019-10-281-29/+25
| | | | | | | No one needs to call this function. Change-Id: I5647475ef2ec7dce5dcf7834245985bfb45632e6 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlJS: Clean up ViewerContextUlf Hermann2019-10-231-1/+1
| | | | | | | | | | The special ctor wasn't used anywhere, the default ctor can be replaced by inline initialization, maybeAddPath is only meaningful in the model manager and the language compatibility check should definitely not pretend to be a general rule either. Change-Id: I11cf25fe1c696550d33b56ce57316100321d564b Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Utils::Environment: Use expanded valuesChristian Kandeler2019-08-201-1/+1
| | | | | | | | | The Environment class is supposed to support values with references to other variables, but we failed to actually expand them in most places. Fixes: QTCREATORBUG-22687 Change-Id: I108cb59d3b4571471423455240f6f4f1cf64bf05 Reviewed-by: hjk <hjk@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-1/+1
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove excess blank lines after namespaceOrgad Shaneh2019-05-271-1/+0
| | | | | Change-Id: I4e4f83017f2bfc2cf842c4c971ed4b05e0447e6a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectExplorer: Rename KitInformation to KitAspectChristian Kandeler2019-02-111-1/+1
| | | | | | | | | | | The name "KitInformation" does not properly convey the fact that it represents a certain *aspect* of a kit. The same goes for "KitConfigWidget", which in addition was inconsistent with "KitInformation". We now use "KitAspect" and "KitAspectWidget". Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97 Reviewed-by: hjk <hjk@qt.io>
* Fix warning: "Don't call QVector::first() on temporary QList/QVector"Alessandro Portale2019-01-281-1/+1
| | | | | | | [-Wclazy-detaching-temporary] Change-Id: I23f5cbd80bb92d3f9f1bfb5ae07493818958c5b0 Reviewed-by: hjk <hjk@qt.io>
* QmlJS: remove qtquick1 leftoversTim Jenssen2019-01-181-5/+1
| | | | | | | | QT_INSTALL_IMPORTS and the used ProjectInfo.qtImportsPath variable were only used for QtQuick1. Change-Id: I34da0cfc77effa84f3a7578e7f91fed0768a9bf4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlJSTools: ModernizeAlessandro Portale2018-12-071-5/+3
| | | | | | | modernize-* Change-Id: Ifc270455ab7500d18798ac0130744662ad3303fb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* QmlJSPlugin: reorganize setuphjk2018-02-081-2/+1
| | | | | | | Pimpl, remove use of global object pool, cosmetics, ... Change-Id: I9e1415b07d7ff8e95db0998c87ce7d75ca638a8e Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* De-emphasize PluginManager::getObjects<Type>()hjk2017-12-151-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by additionally keeping local (currently non-owning) pools per "interesting" type. Current situation: - The global object pool does not scale well for looking up objects, as iteration plus qobject_cast typically iterates over all pooled objects. - User code that can use typed results from the object pool need to have access to the full type definition anyway, i.e. depend on the plugin of the target class anyway. The patch here solves the scaling problem is to have local type-specific pools to which objects register in their constructors and deregister in their destructors. This patch here does *not* change the ownership model of the pooled objects, however, it opens the possibility to change the ownership model per type (e.g. by not putting things into the global pool at all anymore and make the local pool 'owning') and the intent is to handle that in later patchs. Even without the follow-up patches this here is a performance improvement for the cases that access the local pools instead the global one, i.e. "practically all". Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Project: Make Project::file take a std::function to match filesTobias Hunger2017-12-081-8/+7
| | | | | | | | | Make Project::files take a standard function to match files with instead of an enum (and a std::function). Change-Id: I6a24e40dba0e972ff96c0a57e775d2377e2545e0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Project: Make Project::files return a FileNameListTobias Hunger2017-12-081-3/+5
| | | | | Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QtSupport: Add a method to retrieve the QML pathUlf Hermann2017-09-291-1/+1
| | | | | | | | We check that qmake property in many different places. Change-Id: Ifd5efe4ad2831385493bd3afe8538929578e8fb4 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* QmlJSModelManager: Simplify codeTobias Hunger2017-07-251-2/+1
| | | | | Change-Id: Idb4fef70063ce3b42c497e302e4b69bb73f314d7 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Add QML2_IMPORT_PATH to qmlplugindump if defined in build configurationTomasz Olszak2017-07-041-0/+4
| | | | | | Change-Id: I0e3a6beda6cca2a065b2d47115b04362d82c879a Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* QmlJs: initialize qmlDumpEnvironmentMarco Benelli2017-06-081-0/+1
| | | | | | Task-number: QTCREATORBUG-18335 Change-Id: I4f70da8062fde5aadef978f73351d8938d2267eb Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>