Commit Graph

1253 Commits

Author SHA1 Message Date
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
Philip Van Hoof
ba171172e4 qmljs: Make the QMLJsPluginDumper asynchronous to avoid eventloop hangs
Change-Id: I3f6e6acaaf3781d86a0fa5fb100219f92b70f0b5
Fixes: QTCREATORBUG-20243
Task-number: QTCREATORBUG-18533
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-04-27 16:28:09 +00:00
Christian Stenger
20b095c6b4 QmlJS: Fix palette support
Fixes false positive warnings of having no members
and allows to auto-complete its members.

Fixes: QTCREATORBUG-23659
Change-Id: I4da43b9d3f005f9c6cc759ec424bf67062beff78
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-24 10:34:58 +00:00
Christian Stenger
63db0f271f QmlJS: Fix lexer handling of escape sequences
Escape sequences inside strings need to get handled explicitly
to avoid wrong length and offsets of tokens to avoid follow-up
problems while highlighting or symbol interaction.

Fixes: QTCREATORBUG-23830
Change-Id: I4ab0b166bbab22ef3b7b54071e128416a14e97e1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-24 10:34:25 +00:00
Eike Ziller
49626f7ea9 CMake build: Fix devel package issues
Include paths and headers were missing for building a separator
Qt Quick Designer plugin.

Task-number: QTCREATORBUG-23778
Change-Id: Ib6ba96ad42a8b2b36e0ee2f0e3c51c27f3365d37
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-23 10:03:37 +00:00
Ulf Hermann
b86dedb3e8 QmlJS: Tolerate extra members in qmltypes
We are going to add more fields to the qmltypes file format. Qt Creator
should not barf on those.

Fixes: QTCREATORBUG-23855
Change-Id: Ibea5a8270d2236d6b9b87ae672a1526107fe8b3b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-16 06:26:17 +00:00
Maximilian Goldstein
2392f29a59 qmljs: Do not use app.qmltypes and lib.qmltypes anymore
Task-number: QTBUG-82710
Change-Id: I876ec2b8e2b668a239248511b0fbd58389098de6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-27 08:17:07 +00:00
Leena Miettinen
6d484ec120 QML/JS: Fix punctuation of error message
Task-number: QTCREATORBUG-23683
Change-Id: Idb503e00b4f48dfe9ac20d5cc49f6df01153dd20
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-11 10:12:14 +00:00
Tim Jenssen
8573623c6e QmlJS: remove unused QtQuick2 check
Change-Id: I7d613ba825a5ce3d4d8302adff9c98f751bc7ab1
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-03-06 14:06:54 +00:00
Christian Stenger
a82f707ee5 QmlJS: Fix up compile fix
Amends 33b091bd40.

Change-Id: I26d98bae8a074f7c3515b46994afd5548e2ca82f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-04 10:15:16 +00:00
Christian Stenger
33b091bd40 QmlJS: Fix compile
..in general, with tests, and when using a namespaced Qt.
Amends b09a48599e.

Change-Id: I99e275e10df5eed741d021911a360457f0d0d2e7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-04 08:22:12 +00:00
Orgad Shaneh
e4dab6b83e QmlJS: Fix compiler warning and add a missing include
qmljsdiagnosticmessage_p.h: In static member function ‘static QmlJS::Severity::Enum QmlJS::DiagnosticMessage::qtMsgTypeToKind(QtMsgType)’:
qmljsdiagnosticmessage_p.h:72:5: warning: control reaches end of non-void function [-Wreturn-type]
   72 |     }
      |     ^

Change-Id: I2183199bf257453e0af2998b739fae8c90f5c098
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-03-03 17:28:52 +00:00
Orgad Shaneh
989eb36012 QmlJS: Fix Qbs/CMake build
Change-Id: I27b4e2024ad1cddafea7ca7be5eb3055d34bf297
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-03 17:05:17 +00:00
Fawzi Mohamed
b09a48599e Update qmljs parser to Qt 5.15 parser
* 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>
2020-03-03 15:31:10 +00:00
Thomas Hartmann
bbf5ff61ea QmlJSCheck: Allow animations in ui.qml files
Task-number: QDS-1613
Change-Id: I4beecff16d0b67652abbdb16945614d2497d3921
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-02-19 15:47:14 +00:00
Cristian Adam
08202b9110 CMake Build: rename target qmljs to QmlJS
This is in sync with what qmake and qbs project have.

Change-Id: Id82bbd933a8331c3e2032e5068323c183b2a1814
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-16 17:32:24 +00:00
Christian Stenger
6b492866af QmlJS: Add check for duplicated import
Add a soft check for duplicated Qml/JS imports which
adds a warning when a file contains imports that
duplicate the same URI / version or file path.

Change-Id: Ib9a1f8a90dd3cf469d90e83abc1d748901b1e353
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-12-16 06:28:20 +00:00
Christian Stenger
ee77b4fca3 QmlJS: Fix type lookup
Amends 8f682573a8.

Task-number: QTCREATORBUG-15684
Change-Id: I2d35e8f88612d5834519931d00049aa1a99d47c8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-12-10 08:21:06 +00:00
Christian Stenger
8f682573a8 QmlJS: Improve support for multiple imports into same alias
Add extra handling for aliased imports to avoid handling
shadowed imports as unknown which in turn ignored them
and marked their members as unknown types and did not
provide auto completion for their members.

Fixes: QTCREATORBUG-15684
Change-Id: Iee1009cbdfde13ce261854c3239b9b50c434f563
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-12-09 11:37:26 +00:00
Orgad Shaneh
49f6b0146a Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportrunconfiguration.cpp
	src/plugins/python/pythonproject.cpp
	src/plugins/qmakeprojectmanager/qmakestep.cpp
	src/plugins/qmlprojectmanager/qmlproject.cpp
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I22507be28fd80c49c9fee0dff5937a40db176a82
2019-12-07 18:39:54 +02:00
Tim Jenssen
8ebcef7b51 QmlJS: Add "Symbol, Object, Function, RegExp" to global functions
This fixes a false positive error message.

Task-number: QTCREATORBUG-22599
Change-Id: Ibdf9a3a6b1679bd11afa87ca3d5e77fcda773ce0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-06 10:57:12 +00:00
Ulf Hermann
1e587831d1 QmlJS: Scan app.qmltypes and lib.qmltypes for type information
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>
2019-10-31 09:07:57 +00:00
Ulf Hermann
58c023e7c4 QmlJS: Clean up qmljsmodelmanagerinterface.{h|cpp}
Avoid foreach, fix linter warnings, simplify types, apply coding style.

Change-Id: I7cec65e775ee14ce60e1e57077e917285d58c152
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-29 11:45:32 +00:00
Ulf Hermann
3cc6083c27 QmlJS: Use default initializers for LibraryInfo
Change-Id: I1bbad35010af3953ca29a6bb7b79fa0bd5560c88
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-28 07:47:14 +00:00
Christian Stenger
32ae4d0036 QmlJS: Fix warning regarding forward declaration
Change-Id: I37dad31562565b75db2d92b2f956cf8ba629b5a0
Reviewed-by: hjk <hjk@qt.io>
2019-10-26 12:35:37 +00:00