diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2024-06-28 14:07:21 +0200 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2024-07-03 16:36:50 +0200 |
| commit | 02707f1f5ed6e9e2279f509c39dda05d9c121637 (patch) | |
| tree | 2fce83c2c1cdb36dc05dc876a1a7f3a5013c47d7 /src/quickcontrols/doc/snippets/qtquickcontrols-menu-createObject.qml | |
| parent | 4e1aad276ddc8e7a76f09981cb8fccfae2add964 (diff) | |
qmlls: fix regular expression for import completion
Amends 538600cf5adb748f7162aa8ea706072a7874bd02 that introduced the
completion on import statements: there, the import statement is parsed
via a faulty regular expressions "spaceRe" to find out where the
cursor is inside the import statement.
"spaceRe" is used to split the import statements in multiple parts,
namely "import", the module name, "as" and the version number, and
actually does not matches whitespace as one could expect from the usage
and the name: Replace the \\W (which matches non-word characters) in
the "spaceRe" regular expression with \\s that actually matches
whitespace.
Add some tests for the completions on import statements to avoid
suggesting "as" after "import QtQuick.Controls.".
Note that the import statement completion is currently buggy and
should be rewritten using the Dom FileLocations information, as tracked
in QTBUG-126766.
Pick-to: 6.8
Fixes: QTBUG-126712
Task-number: QTBUG-126766
Change-Id: I4bf4c31ba50a7c5002e58756c4de1458ea4eefa3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-menu-createObject.qml')
0 files changed, 0 insertions, 0 deletions
