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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
..in general, with tests, and when using a namespaced Qt.
Amends b09a48599e.
Change-Id: I99e275e10df5eed741d021911a360457f0d0d2e7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
* 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>
This is in sync with what qmake and qbs project have.
Change-Id: Id82bbd933a8331c3e2032e5068323c183b2a1814
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
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>
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>
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>
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>