Qmlls was completely implemented in the ./tools directory, which made
its code complicated to test and try out. Also, it required some "dirty"
hacks in the actual tests (including files from others targets to be
able to use them) and made testing new features for qmlls more
complicated.
To remedy this, the qmlls code was split into a tool (qmlls) and
a static library (QmlLSPrivate). The tool only contains
tools/qmlls/qmllanguageservertool.cpp (which has the qmlls main method)
and links to QmlLSPrivate, that contains all the other qmlls-related
code. This way, the tests can also link to QmlLSPrivate and test out
individual functions there without needing to include files from other
targets.
Also rename all the files to make syncqt happy (adding "_p" to headers
and prepending "q" to headers and files and includeguards), and use
QString::fromUtf8() to silence the QString()-constructor deprecation
warnings.
On the way, move tools/shared/qqmltoolingsettings.* into its own private
static library, instead of recompiling it for each tool that requires
it. Move the qqmltoolingsettings stuff into the qt namespace to be
usable.
Also, add qmlls as a dependency to the qmlls tests to avoid testing an
outdated qmlls-binary.
This commit prepares qmlls's code to implement the go-to and
find-usages features.
Task-number: QTBUG-109006
Change-Id: I91eed689c68a0c53fb88006de335b0f852cc1a83
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The qmlls binary was moved back to bin.
Pick-to: 6.5
Change-Id: Ie14a8562df320b0b76902ce36f6228fda57d4b67
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
qmlls is quite chatty. To figure out what is going on, just pass the
warnings through rather than stringifying them all together.
Change-Id: If01bc75975b0d7b31c41c77529c3a5ccf87caefc
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Use Qt::StringLiterals::_s instead.
Also reflow lines because stricter /Zc options coming in from a
qtbase update make MSVS barf on line-broken u"" ""_s expressions.
Change-Id: I95a2a3d878d2ac506d9c54bbdeb734cf5d94bb8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Import as resolution (i.e. finding a type that was imported with an import as)
was broken in two ways: the shortcut looking for types did look only to types
imported without as, and the normal lookup for symbols declared the ImportScope
as visited (to avoid loops) too early in one case and would skip it.
This was visible in qmlls completions of Controls.
Pick-to: 6.4
Change-Id: Ifc1e777973ddc251bd0685290e8d28bfb025f269
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
testlib's VERIFY and COMPARE macros only work in the function directly
invoked by the test framework.
Temporarily use a copy of the upcoming QTEST_CHECKED marco from testlib
to check that the indirectly called functions actually behaved
currently.
Moreover, move the call to the clean function into a scope guard, so
that it also will be called when the callback returns early due to
failed testlib change – otherwise, we'll end up waiting until the
timeout in QTRY_COMPARE_WITH_TIMEOUT.
Pick-to: 6.4
Change-Id: I371c021f55f11e32950b12a57cf52ad0edb1fd7b
Reviewed-by: Moody Liu <mooodyhunter@outlook.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
use return type for function "details" and add documentation
support by reading comments above a function declaration
Change-Id: I788a47fa574e8e3c4034dc0fa3c3b23c4de264f9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
it's installed in libexec, not 'bin' since 399cdef52b
Change-Id: Id6aa6e76af6f265225d8a91aa6d386b1af384c15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
also add some tests to verify CompletionItemKind based
on current completion output.
Task-number: QTBUG-103765
Change-Id: I1ddf6cf5764f18fef28fe21d1a95d2f5c935ba9a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Fix completions for ids and "." sequences in general.
At the moment does not add attached types and their completions.
Change-Id: Ia62adcf1264f570da43f532fd6679e99c63fe853
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
add an optional notification $/addBuildDirs to communicate
to qmlls the build directories connected to a give uri prefix.
Change-Id: Ic47b941f960195b63c17e26ca5de329d12fec362
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Add support for completions to qmlls. This is a preliminary support
that uses QmlDom. For this reason it has some limitations, mainly
that it only uses QML types, no js completions are provided,
and no type propagation is kept into account.
On the plus side it is immediately up to date when dependencies
are updated.
The completion tries to find in which part of the qml file one is
and distinguishes mainly 4 parts:
* outside all QmlObjects
* in an import
* in a QmlObject, declaring a new binding
* in a script, or similar
It looks at the position in the editor and ts context, namely:
* the word before the cursor (which is used as filter in the client),
* the dot expression before that word
* the whole line before the cursor.
Change-Id: Iefd1332451c060d3d10c68bb427b26c1bc020666
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>