aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljs.g
diff options
context:
space:
mode:
authorSemih Yavuz <semih.yavuz@qt.io>2024-04-22 00:18:58 +0200
committerSemih Yavuz <semih.yavuz@qt.io>2024-05-07 13:34:53 +0200
commitfe258d8e93dfcee54bac522fc6764d1e393d5bb9 (patch)
tree9a2c0d6859afa54a04267351aa9931d9a1ee2fa5 /src/qml/parser/qqmljs.g
parent40543cfaeaaea182af9cacd858c902d7d07ffc0a (diff)
qqmljs.g: Add location for identifier in object destructuring
Otherwise, we can't find the source location of the binding identifier in object destructuring syntax. For example, const {x: y = 34} = obj case, we now can get the location of y which is required for semantic highlighting. Task-number: QTBUG-120000 Change-Id: If8d78e7604179e9a13f62e3fd9ccdb2b3aefd6cd Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljs.g')
-rw-r--r--src/qml/parser/qqmljs.g1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index 57954d7d1a..964b653ebc 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -3399,6 +3399,7 @@ BindingProperty: PropertyName T_COLON BindingIdentifier InitializerOpt_In;
case $rule_number: {
AST::PatternProperty *node = new (pool) AST::PatternProperty(sym(1).PropertyName, stringRef(3), sym(4).Expression);
node->colonToken = loc(2);
+ node->identifierToken = loc(3);
sym(1).Node = node;
} break;
./