summaryrefslogtreecommitdiff
path: root/src/libs/qmljs
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge remote-tracking branch 'origin/9.0'Tim Jenssen2022-10-251-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp src/plugins/qmldesigner/components/stateseditornew/propertychangesmodel.cpp src/plugins/qmldesigner/components/stateseditornew/propertymodel.cpp src/plugins/qmldesigner/qmldesignerprojectmanager.cpp src/plugins/qmldesigner/qmldesignerprojectmanager.h Change-Id: Ib029a830ee99190bc4ea2ad75d9300bfa86b42d9
| * UI text: Use a full stop in the end of messagesLeena Miettinen2022-10-201-1/+1
| | | | | | | | | | | | | | | | | | And fix the capitalization of some message box titles. Task-number: QTCREATORBUG-28334 Change-Id: I858eefd5a12494723c40e0253a3708fa77284d1b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Automatic qmlls support (experimental)Fawzi Mohamed2022-10-122-0/+22
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use more Utils::isMainThread()Jarek Kobus2022-10-111-2/+1
| | | | | Change-Id: Ia3c6f6dca53c5d7487b0813de16f06c52af47aa5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-075-30/+30
| | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-09-191-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf src/libs/utils/fileutils.cpp src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp src/plugins/qmldesigner/designercore/include/abstractview.h src/plugins/qmldesigner/designercore/include/nodemetainfo.h src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp src/plugins/qmldesigner/designercore/model/model_p.h src/plugins/remotelinux/linuxdevice.cpp tests/auto/utils/fileutils/tst_fileutils.cpp Change-Id: I26a21e2523d3d725fdb8c548a531cdbdaeaeca20
| * QmlDesigner: Allow multiple StateGroups in .ui.qmlHenning Gruendl2022-09-131-1/+1
| | | | | | | | | | Change-Id: If7f626f196899ebd49e5f6393d8e3ef81447945c Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | FilePath: Return optional bytearray for file contentsEike Ziller2022-09-121-4/+6
| | | | | | | | | | | | | | For differentiating between "error" and "empty file". Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d Reviewed-by: hjk <hjk@qt.io>
* | Remove outdated version checksRobert Löhning2022-09-121-4/+0
| | | | | | | | | | | | Change-Id: I972a7fe0842a0310ba5df1233a4f417627dad87c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | QmlJS: Avoid an occurrence of FilePath::toFileInfo()hjk2022-09-081-5/+3
| | | | | | | | | | Change-Id: I1c7573caf07e6259115b2d748301d20ec389e6bd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Libs: Add *tr.h filehjk2022-09-013-0/+17
| | | | | | | | | | Change-Id: I827d3bc1fd24cf2e3fb6dbe9d255f12cc91cd409 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | Utils: Replace FilePath part settershjk2022-09-012-7/+6
| | | | | | | | | | | | | | | | | | | | ... by a combined version. This will make it easier to store the parts in one QString object. Change-Id: Ie85a77e3957c78a30e49998fe2e617af35a8ad17 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Use SPDX license identifiersLucie Gérard2022-08-2690-2173/+179
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-08-263-5/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/qmljs/qmljsmodelmanagerinterface.cpp src/plugins/clangcodemodel/clangdclient.cpp src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp src/plugins/qmldesigner/designercore/include/modelnode.h src/plugins/qmldesigner/designercore/model/modelnode.cpp src/plugins/qmldesigner/designercore/model/rewriterview.cpp Change-Id: I93c57879b79f27325321bfc045ca618bd835af93
| * QmlJS: Fix compileChristian Stenger2022-08-241-0/+1
| | | | | | | | | | | | | | Amends 8310a2f0a9a4d. Change-Id: I062a377c9d6f1993f23c5b7e56cca93ad6c3eac5 Reviewed-by: David Schulz <david.schulz@qt.io>
| * qmljs: reduce used threadsTim Jenssen2022-08-233-7/+22
| | | | | | | | | | | | Change-Id: I8f27037d0cfefd65f1ac060e1505328ea705a670 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Utils: Port some FilePath part accessors to QStringViewhjk2022-08-221-1/+1
| | | | | | | | | | | | Change-Id: Ib5cc262e44c73880b6538eed714365e3d685870a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-08-191-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts/comments out parts of 45f93a817a527e6dc81a8971dd2868b3da66cd84, which needs to be resolved in a follow-up commit. Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp src/plugins/clangcodemodel/clangmodelmanagersupport.cpp src/plugins/cmakeprojectmanager/cmakesettingspage.cpp src/plugins/python/pythoneditor.cpp src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp src/plugins/scxmleditor/common/colorsettings.cpp Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
| * QmlDesigner: Allow Timer in ui.qml filesThomas Hartmann2022-08-161-1/+1
| | | | | | | | | | | | Change-Id: I0fbf7270f8514b212fab5aae89d2def11d6b53bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | FileUtils: Adds toFilePathList functionMarcus Tillmanns2022-08-041-2/+3
| | | | | | | | | | | | Change-Id: Ie3137751135fdb6c3161cc886f307323fcce6b72 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | warnings: Fix -Wdeprecated-copyMarcus Tillmanns2022-08-041-1/+0
| | | | | | | | | | Change-Id: Iec5f5edf3752372fd7a0ce94dc26cbf7e75dd8f4 Reviewed-by: hjk <hjk@qt.io>
* | Utils: Use FilePaths alias instead of QList<FilePath>Alessandro Portale2022-07-211-4/+4
| | | | | | | | | | | | Change-Id: I2eb0956377e46a34e73208b301eb662704a25e8b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Drop Qt5: Qml lib / QmlDesigner: Get rid of QOverloadJarek Kobus2022-07-201-1/+1
| | | | | | | | | | | | | | | | Add a context object into some lambdas. Change-Id: I16ee7a0c061483e4d90c9e015852c41a4f3cde90 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Utils: More porting.h related changeshjk2022-07-147-17/+7
| | | | | | | | | | Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | qmljs: (QString -> Utils::FilePath)++Fawzi Mohamed2022-07-1317-401/+489
| | | | | | | | | | | | | | | | | | 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>
* | Utils: Collapse most of porting,hhjk2022-07-137-10/+10
| | | | | | | | | | | | | | | | | | Taking the Qt 6 branches, leaving some dummies until downstream adapted. Change-Id: Ib9b86568d73c341c8f740ba497c3cbfab830d8a1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | QmlJS: Improve parser performancehjk2022-06-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Detaching the rawString_stack alone shows up at 0.85% when loading Creator inside Creator. One write access is actually used from qmljs.g:699, so making the whole function const would need more work. Take a short cut and replace the unneeded reference counted container with a non-reference counted one. Change-Id: I081bf5741899a01e4126b7ffe4f36e4844f0b19e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* | CPlusPlus: Inline more simple Type related functionshjk2022-06-281-1/+1
|/ | | | | Change-Id: I2103e8047b385b438e58072e8a2689f1889d2724 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* cppeditor: Show hints for qmlRegister... diagnosticsMarcus Tillmanns2022-06-212-2/+3
| | | | | | | | | | This fixes passing the hints from FindExportedCppTypes to the actual cppeditor so they can be displayed to the user. Fixes: QTCREATORBUG-27243 Change-Id: Ibcb68296f044a9c6a96f40945d8a0e964be7f042 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* PluginDumper: Connect to done() signalJarek Kobus2022-06-212-23/+11
| | | | | | | Instead of connecting to errorOccurred() and finished() signals. Change-Id: Iaf5fb4ec46919e37b0ab12ec4cbff904ae192de7 Reviewed-by: hjk <hjk@qt.io>
* qmljs: avoid linking to files in the build directoryFawzi Mohamed2022-06-212-6/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cmake creates a consistent uri structure in the build directory. We use that as import path, but when we find a type in them we should refer back to the original file, as editing those is dangerous because any edit are lost with the next build. To find the original file we use the qrc, as the qrc path is mostly the same of as the uri path. It is possible to add prefixes which would make an exact match fail, so we compare the paths from the right to the left and find the longest match. To acheive this: * QrcParser keeps a reversedResources, so the match from right can be done efficiently, and provides a longestReverseMatches method * the model manager keeps a list of all common prefixes of the application paths (build directories), and identify all files in build directories * the method fileToSource identifies the files in the build directory and tries to find the corresponding source file, warning if he cannot find it * fileToSource is used for follow Symbol and find usages We could use fileToSource much more aggressively, to use to in editor content for the files in the build directory, increasing the consistency, but that is a more dangerous change for later. Fixes: QTCREATORBUG-27173 Change-Id: Iea61b9825e5f6e433a7390cf2de9564b792458a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJS: Enhance member lookupChristian Stenger2022-06-201-2/+6
| | | | | | | | | Check for the alias when performing a member lookup on an import. Fixes: QTCREATORBUG-26714 Change-Id: If3febb7d6de9fa2663cdda0143d4aa3590312ca5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix crash of tst_ImportCheckEike Ziller2022-06-101-1/+2
| | | | | | | | We don't have a PluginManager instance when running the autotests. Change-Id: Ib36ea2bb58e500a2ad4b601cedfb8d426fda7e4e Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* qmljsscanner: fix fallthough in nullish coaleshingFawzi Mohamed2022-06-031-0/+2
| | | | | Change-Id: I05c03be4025f7c49d613c350f17cb108ae752ae6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qmljs: add # as commentFawzi Mohamed2022-05-231-0/+6
| | | | | Change-Id: I87a043a39eae57306bc81b3c83f7a363d53be4bd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmljsreformatter: support nullish coalescingFawzi Mohamed2022-05-062-2/+14
| | | | | | | | | | qmljsscanner did interpret ?? and ?. as a single ? and thus as the start of a ternary operator, breaking reformatting. Fixes: QTCREATORBUG-27344 Change-Id: I0429d20aed0196743f1c20e6ceac11351d5a7a3b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CMake: Qt Creator Static build supportCristian Adam2022-04-292-2/+2
| | | | | | | | | | | | | | | | | | | This adds the build system feature that allows Qt Creator's libraries and plugins to be compiled statically. Fixes some symbol clashes when all plugins are linked into the same executable. Support for actually loading static plugins will be added in a separate commit. The feature is controlled by QTC_STATIC_BUILD which by default is OFF. Change-Id: I1fab7953c43e42dc75619e35660029ee067106df Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-04-261-1/+3
|\ | | | | | | Change-Id: I3da1b663a570682201afbe644d6f9299019aae21
| * QmlJsCheck: Add more ids to negative listsThomas Hartmann2022-04-261-1/+3
| | | | | | | | | | | | | | | | Since those are QML keywords those ids can create all kind of unexpected side effects. Change-Id: I9ecb9b0559c57d59104aacedfca505b559de9685 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
| * qmljs: correctly handle js string templatesFawzi Mohamed2022-04-2210-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | In most cases we do want to visit the expressions in a function template. Changing its accept0 would force those not wanting to visit it to iterate on the templates (currently a linked list), so we add a visit method explicitly visiting the expression in all the needed places. Fixes: QTCREATORBUG-21869 Change-Id: I47733544bfd32eec357810b97242608b8f7de572 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-04-221-1/+13
|\ \ | |/ | | | | Change-Id: I01ce83a2da66bb65af37c0ecc92372789cb85c01
| * QmlJS: Fix more invalid M325 casesChristian Stenger2022-04-221-1/+13
| | | | | | | | | | | | | | Fixes: QTCREATORBUG-27380 Change-Id: I76d1ef3d2f2a4cc9d930a006ecb3b564efea3fbc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* | Line length for QML/JS editing automatic formattingXavier BESSON2022-04-072-14/+19
| | | | | | | | | | | | | | | | | | | | Adding parameters to functions in the QML/JS formatter Adding widget and setting to the QML/JS editing settings Fixes: QTCREATORBUG-23411 Change-Id: Ib9d3ac3b22443e81cd636fbc276c6544dab1511b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* | Fix some warningsChristian Kandeler2022-04-011-0/+1
| | | | | | | | | | | | | | Change-Id: Idc12465aa6a3a3d158f17961f902578ca16d0d7b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-03-281-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/studiowelcome/recentpresets.h src/plugins/studiowelcome/userpresets.h Change-Id: Ie573b945eb28347a36ee1b3582fbd6ab0c0f866c
| * QmlDesigner: Add invalid ids to QmlJSCheckThomas Hartmann2022-03-241-1/+2
| | | | | | | | | | | | | | Also improving document message for exceptions. Change-Id: I7878987ce73f5d4891ced3c702c7804b25b07eb3 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* | qmljs: correctly handle js string templatesFawzi Mohamed2022-03-2110-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases we do want to visit the expressions in a function template. Changing its accept0 would force those not wanting to visit it to iterate on the templates (currently a linked list), so we add a visit method explicitly visiting the expression in all the needed places. Fixes: QTCREATORBUG-21869 Change-Id: I47733544bfd32eec357810b97242608b8f7de572 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
* | QtcProcess: Limit the inclusion of qtcprocess.hJarek Kobus2022-03-021-3/+4
| | | | | | | | | | | | | | | | | | | | Move the rest of QtcProcess enums to processenums.h. Move ExitCodeInterpreter into processenums.h. Remove superfluous Utils:: prefix. Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Rename 'output pane' to simply 'output'Thomas Hartmann2022-03-011-1/+1
| | | | | | | | | | | | | | Change-Id: If45e053a32855bca68dc71cb5da22f981146e45b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-02-222-18/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/mcusupport/mcupackage.cpp src/plugins/mcusupport/mcusupportoptions.cpp src/plugins/mcusupport/mcusupportoptions.h src/plugins/mcusupport/mcusupportoptionspage.cpp src/plugins/mcusupport/mcusupportplugin.cpp src/plugins/mcusupport/mcusupportsdk.cpp Change-Id: Ib423e9f23877176f01b188104b0a179ed32c4770