aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* qmlplugindump: Fix overload ambiguityMaximilian Goldstein2021-02-081-5/+6
| | | | | | | | Fixes: QTBUG-89955 Change-Id: I89ce8a146c0ce07c8e308783f79677575458c71c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 40eaa9509b1c2e430b7617e1b42aa66214ad80df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Fix segmentation faultMaximilian Goldstein2021-02-041-1/+1
| | | | | | Change-Id: Ie04ad4221b25628687c2575facf90488b83d21bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5fb34b67b810ca284c216009925f4f38220c4510)
* qmllint: Fix auto-importing of qmltypes from same directoryUlf Hermann2021-01-221-1/+3
| | | | | | | Fixes: QTBUG-90513 Change-Id: Ic39e72d6df20be30c61123a7f8091d70dbc2d924 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9b407b68d1fc0abe08091aa7ca007fbf0f03fb89)
* CMake: add properties when tools are builtSamuli Piippo2021-01-181-1/+1
| | | | | | | | | Make sure all properties are added when cross-compiling the tools. Change-Id: Ifec0d2e2a1de2c3302ccf71ba897993d57bed205 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 066945fbc4a633fec57ccf458a0534f6ea525478) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlformat: Remove import sortingMaximilian Goldstein2020-12-163-54/+9
| | | | | | | | | | | Remove import sorting due to the fact that sorting imports can break code. [ChangeLog][QML Tooling][qmlformat] Remove import sorting and the (now obsolete) -n parameter to disable it Fixes: QTBUG-89295 Change-Id: I5ff13d0ae3c715db7645b412152aadb31811ce5a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cf3e0559b01b249a6ec06f8826e8e05aca1301ec)
* Use load(qt_tool) and qt_internal_add_tool for qmltimeLi Xinwei2020-12-073-7/+41
| | | | | | | | | The qmltime should be a tool, not a normal executable or an app. Change-Id: I64c76877907297a6a817ba5903786bcc7fba8fdd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e6e262da1423bcb7cfe3db9f83fe0df54483c8d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-181-4/+3
| | | | | | | So we can remove it. Change-Id: I037373f85c696ce04c55920b41377cc9843b0da3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QmlCompiler: Allow more convenient access to enums in QQmlJSScopeUlf Hermann2020-11-121-2/+2
| | | | | Change-Id: Ibac4dd7641a89b686bee63cf974b2257a35631a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Standardize QJsonArray iterationDavid Skoland2020-10-281-1/+1
| | | | | | | | | When using refs as loop variables, the clang compiler complains (with default settings). This prevents that. Note that QJsonValueRef is used "behind the scenes", which makes this iteration method correct. Change-Id: I5a5f58ca8ad3887bce2009231cbae5a57c107697 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qmllint: Check identifiers before giving up in case of previous errorsUlf Hermann2020-10-271-4/+2
| | | | | | | | The identifier check might yet yield more information. Change-Id: I96f700acf257736fea7e9c2023b9e8797f702f7c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* QmlCompiler: Add JS scopes for script bindingsUlf Hermann2020-10-271-3/+5
| | | | | | | | This is necessary to identify the available QML and JS scopes for the binding, and to add any identifiers found there. Change-Id: Ic966e7817ccd1fdc064dd433d16fa6c42c9110cc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Introduce grouped scopesUlf Hermann2020-10-272-0/+35
| | | | | | | | This way we can analyze the left hand part of things like "anchors.fill: parent" in qmllint. Change-Id: I0f58312566c3d5062e0fb301c2bad908ab8b8cbb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace deprecated DataLocation with AppDataLocationShawn Rutledge2020-10-251-1/+1
| | | | | | Task-number: QTBUG-87037 Change-Id: I1cb6cd15fbb5fe08a0280ed83d01fc1b49249524 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* qmlcachegen: Move functions to compile QML/JS files to QmlCompilerUlf Hermann2020-10-231-375/+13
| | | | | | | | We need to re-use them. Also, provide a way to insert AOT compiled functions into the C++ code. Change-Id: I7b0d13cb307e8f979745f096a9614f087d135f68 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlcachegen: Add empty AOT built functions to the loaderUlf Hermann2020-10-231-1/+11
| | | | | | | | This enables us to use the same generateloader.cpp for qmlcachegen and any replacement that actually produces AOT compiled functions. Change-Id: I12fe81236e4ef16a627729c644d54b6c171b3860 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move generateloader.cpp to QmlCompilerUlf Hermann2020-10-235-244/+7
| | | | | | | We need to be able to generate the loader code from multiple places. Change-Id: I9e04fd3583b535bc5f7d5fb293cb61309c1e199a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Properly discern between inherited and own namesUlf Hermann2020-10-222-43/+48
| | | | | | | | | | | Previously, we would mix them up on importExportedNames(), which was also misnamed. Now we keep them in their proper place in the scope hierarchy, so that we can identify which scope a property came from. Exceptions are the qmllint-specific treatment of parent properties and Connections elements. Change-Id: I7c012388b16c83439d6f2de2e83fac0da4940d30 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: fix typoUlf Hermann2020-10-221-1/+1
| | | | | | Change-Id: Ia661141095a865191945f41bad91429ef952e16c Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove dead codeUlf Hermann2020-10-211-3/+0
| | | | | Change-Id: I5898402604fe29731dc518d42a441ff852706af3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Compile with Clang11Lars Knoll2020-10-211-0/+4
| | | | | Change-Id: I9f3a4a6b6c7a2fbfca0a572209f398a23c26b37b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlcachegen: Move resourcefilter.cpp into QmlCompilerUlf Hermann2020-10-205-179/+3
| | | | | | | | For backwards compatibility, a replacement for qmlcachegen will need to provide the same functionality. Change-Id: I22664230ea636d384190122223d15819ebee930c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Pass source location to all scopes from QML filesUlf Hermann2020-10-151-2/+2
| | | | | Change-Id: Ic0aeb152acb0d90d15cc48a55c0ad5b15a60a6eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Further unify findwarnings.cpp and qqmljsimportvisitor.cppUlf Hermann2020-10-152-248/+58
| | | | | | | | Most of the logic in findwarnings.cpp applies also to imported files and should live in the base class. Change-Id: I65f326f50a8bfab0dff4b5b31f7bee7300b20704 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Unify QQmlJSImportVisitor and FindWarningsVisitorUlf Hermann2020-10-154-184/+21
| | | | | | | | | They are both pretty much doing the same thing, except that the import visitor is not as thorough. We need the full analysis in QtQmlCompiler, so we successively move the code over. Change-Id: If7fb47f88165fd8b61f4ccc408ccfbb7dad533e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Defer resolution of types read from QML filesUlf Hermann2020-10-152-6/+6
| | | | | | | | | | When importing a directory we most likely don't need all of the files in the directory. Therefore we now parse them only when they are accessed. This speeds up the execution and will allow us to process imports recursively without running into infinite recursion. Change-Id: I0c79313de792249e6bb86144b5014a7787dbdc5b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Unify the printing of diagnosticsUlf Hermann2020-10-152-30/+63
| | | | | | | | We can use QQmlJS::DiagnosticMessage to carry message, type, and location. Change-Id: I3868bc8035b4da13efad0d1b7d2f8dfeff1ef234 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Don't register the component we're just parsing as importUlf Hermann2020-10-141-4/+0
| | | | | | | | | I can't think of a scenario where this actually makes sense and none of the autotests exercise it. Change-Id: I6361d38e02f1cdac60ee5a4e1b8287491c3b05e6 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow optional imports in qmldir filesUlf Hermann2020-10-081-1/+1
| | | | | | | | | | This is useful for modules that select their imports at runtime using qmlRegisterModuleImport(). We can list all possible variants as optional imports so that tools can see what types might be available. Task-number: QTBUG-87130 Change-Id: I8a37bdde79aef3619fd1f05e5ea6781d521afa88 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlformat: Make arrow functions one linersMaximilian Goldstein2020-10-081-4/+16
| | | | | | Fixes: QTBUG-87179 Change-Id: Ieb7dffab59923bcb2ce8745c499eff7de44134b1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmlformat: Make empty objects one linersMaximilian Goldstein2020-10-071-0/+4
| | | | | | Fixes: QTBUG-87181 Change-Id: Ic8b7f69b4f9faf907ec75f27b689ba3686eb013f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlformat: Fix computed property namesMaximilian Goldstein2020-10-071-1/+5
| | | | | | | Fixes: QTBUG-87222 Pick-to: 5.15 Change-Id: If1da02d503041009b82651e1087fb4a1bdd79d59 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: Capitalize importer warningsUlf Hermann2020-10-074-52/+59
| | | | | | | Refactor the "prefixed message" mechanism into ColorOutput. Change-Id: Ie982e641771f3367406f48a8bcfd2bd3da122b16 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-0624-56/+56
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* qmlformat: Fix formatting of for...of loops using array variablesMaximilian Goldstein2020-10-061-1/+4
| | | | | | | Fixes: QTBUG-86980 Pick-to: 5.15 Change-Id: Id27350821051709894c7645a362cfdf7ce0d279c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlCompiler: Split importFileOrDirectory() in twoUlf Hermann2020-10-061-5/+10
| | | | | | | | | | | importing a file and importing a directory are really quite different things and the code paths inside the function were completely separate. We also don't have to create a map of ImportedTypes if we are only going to return a single one. Change-Id: Ifbb0caa70e9272dfde2d9f1cf5ed1b102e02f5cc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlformat: Fix inline componentsMaximilian Goldstein2020-10-052-38/+11
| | | | | | | Fixes: QTBUG-86979 Pick-to: 5.15 Change-Id: Ie8863bc2ecf75a9dd8e4af5e96e48c30e7acbacd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Move ScopeType and JavaScriptIdentifier into QQmlJSScopeUlf Hermann2020-10-053-36/+44
| | | | | | | | They don't begin with 'Q' and they are not very useful outside of QQmlJSScope. Change-Id: I3363ac4d29be7a9cb5c9f7f3af1727c99e886825 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename TypeDescriptionReaderUlf Hermann2020-10-052-2/+2
| | | | | | | The names should begin with a common prefix. Change-Id: Ibd832ebe7a778c7af8ee3b75253e04491ded28be Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename QmlJSTypeReaderUlf Hermann2020-10-051-1/+1
| | | | | | | Add an extra 'Q' for consistency. Change-Id: I81324f3b6e4d26a29f3bcc40b03abfa137292ea0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename QmlJSImporterUlf Hermann2020-10-052-6/+6
| | | | | | | Add an extra 'Q' for consistency. Change-Id: Idd34e0c898c9a7ac70b1ec3856a8af6829ec6fb7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename QmlStreamWriterUlf Hermann2020-10-054-8/+8
| | | | | | | The names should start with a common prefix. Change-Id: Ib2cc247d459d78de5f0a8ea0be73b89429154475 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename ResourceFileMapperUlf Hermann2020-10-052-5/+5
| | | | | | | The file class names should start with a common prefix. Change-Id: I5e014c103668a1bc73d359b00a1dda33e5637a79 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename ImportedMembersVisitorUlf Hermann2020-10-051-1/+0
| | | | | | | The class names should start with a common prefix. Change-Id: I645ef476f8493d38c2f4c5241d4a2903543f09e8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename metatypes_p.hUlf Hermann2020-10-053-11/+11
| | | | | | | Those are specific to QML/JS. Change-Id: I45a5d4eb6c53bd5ca4026e042af83c4afaa4953c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Rename ScopeTree to QQmlJSScopeUlf Hermann2020-10-054-34/+34
| | | | | | | That is a better name. Change-Id: I34a6867692a236dd16ed8e3a68866f994eab02d2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live libQtQmlCompiler!Ulf Hermann2020-10-0534-2807/+33
| | | | | | | | Move all the code from tools/shared into src/qmlcompiler and build a static library from it so that we can re-use it in external tools. Change-Id: I7c8d8e59063dc7c711f4072f103a01095e6f5997 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove member access chains from ScopeTreeUlf Hermann2020-10-026-40/+28
| | | | | | | | | What we need there is a proper type inference. This should be added separately. For now, keep the member access chains local in qmllint and don't pollute ScopeTree with them. Change-Id: I9f50aa4e54b285bd93e7bd4cd17797509df0c168 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove ScopeTree::m_unmatchedSignalHandlersUlf Hermann2020-10-025-37/+23
| | | | | | | | Rather, immediately output the warnings when we encounter them. Change-Id: I4bd1a5491a47cb0232bfdd4e325f8f122593aa39 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Unify injected and "normal" JavaScript identifiersUlf Hermann2020-10-026-87/+142
| | | | | | | | The specifics of how to warn about the injected identifiers are moved out of ScopeTree as that is not related to the structure of the scopes. Change-Id: I26418c3fa492da8339abf045a4034a8464b7bbb8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Remove ComponentVersionUlf Hermann2020-10-0210-166/+28
| | | | | | | QTypeRevision does all we need there. Change-Id: Ib27ae2d58167a7a45fac31262a45e387d047af89 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>