summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsutils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace a few \returns by Returnshjk2023-03-241-2/+3
| | | | | Change-Id: I09c633e610421f5cc8257b15de60ffa98d890ee0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* 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>
* 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-14/+16
| | | | | | | | | 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>
* QmlJS: Fix issues with getting modulePathsEike Ziller2021-09-071-13/+31
| | | | | | | | | | | | | | | | | | This patch - improves performance by removing the usage of QRegularExpression for trivial string operations (this is called 3000 times after configuring Qt Creator) - fixes handling of version number like "2.-1" which are the result of imports with only a major version number like "import QtQuick 2" Task-number: QTCREATORBUG-25899 Fixes: QTCREATORBUG-26178 Fixes: QTCREATORBUG-26216 Change-Id: Ic792909513f4fe25ac72043645f297ee41890375 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* qmljs: update Qml parser to parser of Qt 6.2Fawzi Mohamed2021-07-201-1/+1
| | | | | | | | | this is needed (among other things) for * null coalescing * shebang support Change-Id: I1b37fd86593f143de8b39c0daf433831a8785568 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlJS: Fix handling multiple import paths into same moduleChristian Stenger2021-01-211-6/+7
| | | | | | | | | | | It is possible to import components of different paths to fill a module. Take further paths into account when looking up types. Fixes: QTCREATORBUG-24405 Change-Id: I8d6bf0a324ea9c0d1fe9d91b40857f91f00dd662 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* Make QmlJS(Tools) build with Qt5 & Qt6Eike Ziller2020-09-171-2/+2
| | | | | | | Port from QStringRef to QStringView Change-Id: I472d16f20e40ca52b8e5d481850a6bd8a1a38f3b Reviewed-by: hjk <hjk@qt.io>
* Utils: Drop Utils::SkipEmptyParts againhjk2020-07-211-1/+1
| | | | | | | | We require Qt 5.14 nowadays. Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlJS: More Qt6hjk2020-06-191-1/+3
| | | | | | | Mostly QRegExp, one QHash::unite. Change-Id: Ia2816fee65b9459c0f89419161f44c38cd572c36 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Update qmljs parser to Qt 5.15 parserFawzi Mohamed2020-03-031-1/+1
| | | | | | | | | | | | | * parser side support for annotations, inline components, new UiVersion and all the things included in QT 5.15 parser * SourceLocation moved from QmlJS:AST to QmlJS * Visitors now need to handle throwRecursionDepthError * BaseVisitor for visitors that want to override all visit Task-number: QTCREATORBUG-23591 Change-Id: I682a30d0b08b6c929739fd0e339ef6fbde3eb630 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Some clang-tidy -use-modernize-nullptrhjk2019-08-011-3/+3
| | | | | Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlJS: Fix compile using Qt5.6 on macOSChristian Stenger2017-04-241-1/+1
| | | | | Change-Id: I3d8dd1ad1d149be24d9a3af1c9a5e8bfb4228c67 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Use QString::*Ref methodMontel Laurent2017-04-211-2/+1
| | | | | | | Change-Id: I63a10f274dd17e08b5b8a2577762cc9f7960b5af Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlJs: fixes bug in module import search.Marco Benelli2016-06-231-14/+18
| | | | | | Task-number: QTCREATORBUG-16425 Change-Id: I5fdd1a5882730c0f52dba5edb8cf8ca7092a4409 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* QmlJs: handle the undefined version in module lookup.Marco Benelli2016-05-131-4/+14
| | | | | | | | | | | | The module lookup used to not consider the undefined version (-1.-1) a valid version number. This caused QtCreator to crash because of a failing assertion. This patch makes the assertion more permissive and handle the lookup of an undefined version by substituting it with an empty string. Task-number: QTCREATORBUG-16220 Change-Id: Iac574cfc04b4718b0d0809352e5c9456e4392e83 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* QmlJS: Avoid infinite loop on empty list of import pathsUlf Hermann2016-05-091-0/+2
| | | | | | Change-Id: I1b7bade71226e4181b2643cabb53f934930afc81 Reviewed-by: Marco Benelli <marco.benelli@qt.io> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
* QmlJs: search for version in parent modules.Marco Benelli2016-05-041-0/+63
| | | | | | | | | | Modules used to be searched by name with optionally an attached version. Now, if a module with version is not found, the version is attached to the parent module. Task-number: QTCREATORBUG-16145 Change-Id: Ie0f30d4df64d13b3ec4c5ee38e9ad9215ae56420 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
* Preferably use QStringRef::toInt().Friedemann Kleint2016-02-041-1/+1
| | | | | | | Avoid allocations for converting to int. Change-Id: Id8c79334f4809ec075ffe7e6b7635be4873eafd8 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Clean headers in lib qmljs and plugins qmljstools, qmljseditor.Friedemann Kleint2015-03-051-0/+2
| | | | | Change-Id: I3256db8f4d42b6326d986d754b45e6c6c2030839 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* qmljs: added qmljsconstants.hFawzi Mohamed2013-10-231-1/+1
| | | | | | | | | | | | | | Moved Document::Language, Import::Type and StaticAnalysis::Severity enums to qmljsconstants.h and renamed values removing the redundant part. Thus the effective length changed little or improved (Document::QmlLanguage => Language::Qml). The separate file allows better reuse of enum values without introducing circular dependencies. Change-Id: I5186d7c04f5d3f6c289068b919be5ff1ff118326 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* qmljs: add vector*d, quaternion, and matrix4x4 to code modelFawzi Mohamed2013-08-221-0/+4
| | | | | | | | | | Added vector2d vector4d, quaternion and matrix4x4 to basic types and extended completions related to them in the code model. Task-number: QTCREATORBUG-9929 Change-Id: Iafdbdf5792f640e8eb29d866a372542ee07159a5 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add missing copyright headersTobias Hunger2012-03-051-0/+32
| | | | | Change-Id: I71f9050a7de9c7b07bcd7d96c8e5fc64a8565fb0 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
* QmlJS: Documentation.Christian Kamm2011-11-071-0/+5
| | | | | | Change-Id: I2a095e38b7d79a5fb39a16d8f32b48c8e28132f6 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Handle inner ids in 'Wrap in Loader' quick fix.Christian Kamm2011-11-041-2/+5
| | | | | Change-Id: I7385f49928db78abd2deb7783ca0a38288ae7446 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Clean up idOfObject() and folding text code.Christian Kamm2011-10-281-22/+12
| | | | | | Change-Id: Id3e9d24689c67ce0e12b12b82636177a0344ede1 Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Add quick fix to wrap element in Loader.Christian Kamm2011-10-191-7/+18
| | | | | Change-Id: Ie8b1624abfd9faa8c6153ad99e48964d597d543c Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Move commonly used functions to qmlutils.h.Christian Kamm2011-10-101-0/+162
Change-Id: I22376d96fe575bc00a55094c06af80e32a5587e6 Reviewed-on: http://codereview.qt-project.org/6238 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>