Commit Graph

1277 Commits

Author SHA1 Message Date
Alessandro Portale
c68f49fefa Remove unused private functions
As found by Cppcheck.

Change-Id: I697ea69992425ff41e35990ad00be312b35ba70a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-08 09:06:02 +00:00
Eike Ziller
8b031c8c05 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I3f2a6c553819e992da7e9f538dc44b95b482359e
2020-10-02 10:47:07 +02:00
Fawzi Mohamed
1b134a6909 QmlJS: accept import without version
Since Qt 6 import without version are accepted and should import
the latest version.

Change-Id: Id98bd0f7664dd77b30b9c91ee153fccc4160fc6d
Fixes: QTCREATORBUG-24533
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-01 12:35:22 +00:00
Fawzi Mohamed
89c8021c5c QmlJS: fix reformatting of required properties
Fixes: QTCREATORBUG-24376
Change-Id: I9ebe66f881575ce8e58cee46d34c3ff8da55ef9c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-01 08:47:14 +00:00
Fawzi Mohamed
eddf2bead8 QmlJS: fix operator << of Trie to QDebug
Change-Id: I0a540c7b1842fff9652a7ced01697eae2e90b0e0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-30 07:09:36 +00:00
Fawzi Mohamed
45716a4ccc QmlJS: set and propagate qtVersion in ProjectInfo
Change-Id: Icbeb3679c8a76c111a5e3503b2c496c28c830342
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-29 14:24:14 +00:00
Eike Ziller
4dc9d92b1e Remove unneeded QStringList forward declarations
Fixes build issue with Qt6, for which QStringList is now a
QList<QString>.

Task-number: QTCREATORBUG-24098
Change-Id: I0c81aa5bae413b836dbedea0bb6117b46f6f24c2
Reviewed-by: hjk <hjk@qt.io>
2020-09-29 08:58:12 +00:00
Thomas Hartmann
f1c9f8e628 QmlJS: Do not change strings referenced by QStringView
QStringRef is stable under reallocations of it's string()),
while QStringView is not.

This adds the missing changes from qtdeclarative 1b10ce6a08e.

Task-number: QDS-2825
Change-Id: I120a34153424ea514abaa783f1a617ef2f8b4cf4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 16:00:54 +00:00
Alessandro Portale
dc1439dedd CMake build system: Propagate less target dependencies and includes
...and thereby have less include paths per compile unit.

Change-Id: I70de8db12d881ea827595ca0cacaea13b5c0f3bd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-21 10:53:12 +00:00
Eike Ziller
cf2a651c3b Make QmlJS(Tools) build with Qt5 & Qt6
Port from QStringRef to QStringView

Change-Id: I472d16f20e40ca52b8e5d481850a6bd8a1a38f3b
Reviewed-by: hjk <hjk@qt.io>
2020-09-17 09:37:23 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Thomas Hartmann
f641434ec1 QmlJSCheck: Fix crash
Task-number: QDS-2766
Change-Id: I4b0e81b8104ac35a286a318e87e95ea022ed66f6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-09-14 12:21:49 +00:00
Orgad Shaneh
e504d96934 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I8a2dca29595a0770f4162786b15a145f3f4133af
2020-09-04 16:11:12 +03:00
Thomas Hartmann
356acf16b8 QmlJSCheck: Workaround for ListElement
When editing QML there are false positives reported
for ListElement.

Task-number: QDS-2602
Task-number: QDS-2716
Change-Id: If3fc297d6609213448f8353e9406b3f0aaf65870
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-09-03 11:22:32 +00:00
Eike Ziller
5183994a30 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ibb60b8a7ac531b239bb9c490da843d5cc1a6300a
2020-08-14 13:31:05 +02:00
Christian Kandeler
b19c5969d8 QmlJS: Fix crash
Fixes: QTCREATORBUG-24477
Change-Id: I45ab28fd11d8c9e51fb3b537a677620ecee5985b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-08-14 08:01:07 +00:00
Robert Loehning
0f7447e1b1 QmlJS: Remove redundant white space
Change-Id: Ic999c6ca85b8f5bbbc9d4a808805196006dbe60c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-08-10 17:04:26 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
hjk
f41f153882 Adapt qmljslexer to Qt base change caa40f57d4d
qstrtod is no longer exported.

This effectively reverts commit 149cc3af6 as it causes an explicit
dependency on private headers, leading to more problems downstream
than the implicit dependency using the declaration.

Change-Id: I93a9cfc6e440b20d6bed51504bb8004fd67f341c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-08-10 07:45:17 +00:00
Thiago Macieira
149cc3af6b Fix build with Qt 6: qstrtod is an inline function
Change-Id: Ib620871532484bcaa43cfffd1628d6bf0f93fd78
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-08-08 16:50:37 +00:00
Fawzi Mohamed
2ad89747c4 qmljs: qtdeclarative change 9ab1a6759018b78b0f160c5286f8b0235a34ec50
Support required list properties

The corresponding rules were missing so far.

Fixes: QTBUG-85716
Change-Id: Iaf0cbfbb8736929a213bd6bf329bb2ebdde652c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-03 06:59:36 +00:00
Fawzi Mohamed
1ea9d6ce87 qmljs: fix unreachable test for catch clause
Change-Id: Ica1ff034b88f06849026957c8beed2cda77badcc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-03 06:31:08 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
Christian Stenger
6e29adaae7 QmlJS: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: I70157bcbee67cf493e28b5bad97248877a25e5c6
Reviewed-by: hjk <hjk@qt.io>
2020-07-20 10:23:52 +00:00
Eike Ziller
b18711da91 Merge remote-tracking branch 'origin/4.12' into 4.13
Conflicts:
	share/qtcreator/debugger/lldbbridge.py

Change-Id: Ia444f6424fb35b9a539e157afcee868161535272
2020-07-06 16:23:13 +02:00
Christian Kamm
2c2cd08761 QmlJS: Fix codemodel reset
The QML import paths weren't scanned for modules when the code model was
reset.

Task-number: QTCREATORBUG-24082
Change-Id: If818ebf4ef123529e5fe8de40e6b5d0154c84680
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-06-30 08:57:28 +00:00
Tim Jenssen
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02:00
Tim Jenssen
5a06305ffe qmldesigner: enable Transion in QmlUi files
Change-Id: I2e35e8a2dc7b946297c70fd775bd3e3366295271
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-26 12:38:18 +00:00
Thomas Hartmann
ad17ea9611 QmlJS: Fix false positives for Connections
Connections and ListElement are in the QtQml scope,
when using type information from Qt kit.

Change-Id: I6236a317117e15f4b68c0642186bfdb91d0c92db
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kamm <mail@ckamm.de>
2020-06-25 08:10:43 +00:00
hjk
54575fe42d QmlJS: More Qt6
Mostly QRegExp, one QHash::unite.

Change-Id: Ia2816fee65b9459c0f89419161f44c38cd572c36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-19 07:13:06 +00:00
Eike Ziller
8b8ecfa28f Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/fileapiparser.cpp

Change-Id: I39f8c2be859be043f506bef77de9bb5b42d38165
2020-06-15 11:30:34 +02:00
Christian Kamm
39ad832686 QmlJS: Resolve missing QEasingCurve prototype
This helps with resolving QEasingCurve's prototype, which is only
available once QtQml has been loaded.

Task-number: QTCREATORBUG-24142
Change-Id: Icb19491071c195c16c527bd206ffdea6f5806b4e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-12 12:24:37 +00:00
Miikka Heikkinen
7f4bf437da QmlJS: Add a way to return just the context of the project of a file
Added ModelManagerInterface::projectVContext() method to return just
the context of the project the file belongs to and nothing more.

To make this possible, fixed caching the file-to-project relationships
and removed automatically adding the currently active project to
list of projects the file belongs to in allProjectInfos().

Task-number: QDS-1495
Change-Id: I949c0202d0280264b6856562a2e7abc2f93d13c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-11 12:42:20 +00:00
Christian Stenger
ba580bba83 QmlJS: Fix line number for string literals (Part 2)
Amends 626807c94e. Scanning the strings appears differently if
using multi-line strings and using the line terminator at the beginning
of a string or having already some characters present.

Fixes: QTCREATORBUG-23777
Change-Id: I840a11e3b0e06adda443849f926189bda9dc2e4b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-06-10 13:07:23 +00:00
Christian Stenger
f4157e81d2 QmlJS: Fix superfluous whitespace
When dragging a property on itself inside a "oneline" item
Qt Creator prefixes a single whitespace even if it contains
already whitespace(s).

Change-Id: I3028d8c44d9b91d51c96a6d363e48a877a6a78da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-09 12:29:08 +00:00
Miikka Heikkinen
9b91b51285 QmlJS: Return correct default value for vector*d builtin types
This fixes the warning that comes when using "myvec.x: 10" style of
defining  qml vector*d properties.

Task-number: QDS-2189
Change-Id: If77373a4dd8483b65dd782502efb774b95844583
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-09 12:21:54 +00:00
Christian Stenger
128341d4e2 QmlJS: Fix possible duplicate semicolon
When dragging a member inside or onto a "oneliner" item a
duplicate semicolon can appear which makes the code invalid.

Fixes: QTCREATORBUG-12560
Change-Id: Ifa824a64b951fde879625d321dfae48e167a9227
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-09 09:37:29 +00:00
Eike Ziller
c644e7c80a Merge remote-tracking branch 'origin/qds-1.59'
Conflicts:
	src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
	src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp

Change-Id: Ifa7c66330c1995378280cdb4c57c30015dc11b68
2020-06-08 16:04:15 +02:00
Thomas Hartmann
afb499a138 QmlJSCheck: Add Error message for recursively instantiated type
Change-Id: I68b46a929c65fb21ee8473cda44f7de4e40009c7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-04 13:45:56 +00:00
Christian Stenger
e2ae2ad41d QmlJSEditor: Support dragging of functions
Currently you can drag around items and properties.
Extend this by JS functions.

Fixes: QTCREATORBUG-21993
Change-Id: I2934450cbaf8646620b43ce33fdb523b5d2803ab
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-04 06:35:49 +00:00
Christian Kamm
40dd6fc185 QmlJS: Add workaround for missing imports in Qt >=5.15.0
The QtQuick module plugins.qmltypes in Qt 5.15.0 do not contain
QML types like QtObject. Instead, they are found in the QtQml module.

Something similar applies to QtQml and QtQml.Models and
QtQml.WorkerScript.

As Qt 5.15 can't use the "import" command in the qmldir file, this code
instead detects the 5.15 QtQuick and QtQml modules and adds the
dependent imports manually, as a workaround.

Change-Id: I982e349298eb7200372390dfc384fb43a762b253
Task-number: QTCREATORBUG-23986
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-21 07:54:08 +00:00
Christian Kamm
f64146741d QmlJS: Use "import" commands from qmldir files
qmldir files can have lines like "import QtQml". These were already
parsed, but not stored in LibraryInfo. Store them.

When imports are resolved in Link and a library has such an import, also
load the module it refers to, with the same version and "as" scope.

Add a test to verify the behavior works.

Change-Id: I80b260bfaa36a9e5de0849fa5632b3361077ef01
Task-number: QTCREATORBUG-23986
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-21 07:53:44 +00:00
Christian Kamm
338fa26bc3 QmlJS: Scan import paths, even if there is only one
Previously a single QML import path would not be scanned. This did not
usually happen to users, as there's almost always more than one path.
But it could lead to unexpected behavior in tests that explicitly
controled import paths.

Change-Id: I015f44f183ad484c333ab7a4e5e98b87098620a7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-21 07:53:24 +00:00
Christian Kamm
96c860159b QmlJS: Track futures to allow testing
Tests often want to wait for all async tasks to finish before
progressing.

Change-Id: I61738df730ca341b5c9d227569d961cd1991b296
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Philip Van Hoof <philip@codeminded.be>
2020-05-21 07:53:11 +00:00
Christian Kamm
037ff590e6 QmlJS: Fix loading builtin library info
The condition was always false, since projectInfoForPath always returns
an empty project member. This meant the the fallback builtins that ship
with Qt Creator were used, instead of the builtins that shipped with the
Qt version.

Change-Id: I9c3bf949d0046bcf687c913e32ddac95734f6c43
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-21 07:52:51 +00:00
Christian Kamm
6dc87d96b7 QmlJS: Fix bug with async typeinfo loading
There were infinite loading loops, because the unupdated LibraryInfo was
written to the ModelManager.

Change-Id: I22faf017a2c9370e97042152cddc872a3d35fb77
Reviewed-by: Christian Kamm <mail@ckamm.de>
Reviewed-by: Philip Van Hoof <philip@codeminded.be>
2020-05-18 10:27:09 +00:00
Eike Ziller
be73f41ad4 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ib95ec2c50c4bbaefd4ed0ec5af191ccc846c824f
2020-05-04 10:52:34 +02:00
Christian Stenger
626807c94e QmlJS: Fix line number for string literals
When a string value's first line ends with an EOL the
line number for the next line got wrong which in turn
confused the syntax highlighter.

Fixes: QTCREATORBUG-23777
Change-Id: I37eed839a2e63cf470b9bc2ac0596ab8bc8d373c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-29 16:09:08 +00:00
Christian Stenger
549b5719f6 QmlJS: Fix lexer handling of escape sequences (again)
The lexer handled escape sequences already, but not fully
correct.
This effectively reverts 63db0f271f and fixes the wrong
offset.

Task-number: QTCREATORBUG-23830
Change-Id: I2cc1e9df5c0218cf9ee80998adce69bbc2eb4dab
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-29 13:48:11 +00:00
Philip Van Hoof
a6f69d6142 qmljs: Use Utils::onFinished instead of manual QFutureWatcher
Change-Id: Iad6b958cb87ea5d4edaa270c27fac5ffdc334bba
Fixes: QTCREATORBUG-20243
Task-number: QTCREATORBUG-18533
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-27 16:29:46 +00:00