diff options
| author | Ben Cho <ben.cho@qt.io> | 2024-11-27 16:33:48 +0100 |
|---|---|---|
| committer | Ben Cho <ben.cho@qt.io> | 2024-11-27 16:32:33 +0000 |
| commit | 588250efc75b88877c03d43d703e621c148d8ff5 (patch) | |
| tree | cb94dac7cb4495fc2018cc3fc29a612aaec9350f | |
| parent | e9a8c58bb101161cb994d408f0a3ba94932aa9f4 (diff) | |
qt-qml: Fix syntax highlighting for QML files
When an object is used as a property value,
it is highlighted incorrectly. This patch fixes that issue.
Task-number: VSCODEEXT-105
Change-Id: I8cc4f206ed181be945674b5512b78260d321ad30
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
| -rw-r--r-- | qt-qml/res/lang/qml/qml.qmlproject.tmLanguage.json | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/qt-qml/res/lang/qml/qml.qmlproject.tmLanguage.json b/qt-qml/res/lang/qml/qml.qmlproject.tmLanguage.json index 8f90012..43aaf51 100644 --- a/qt-qml/res/lang/qml/qml.qmlproject.tmLanguage.json +++ b/qt-qml/res/lang/qml/qml.qmlproject.tmLanguage.json @@ -89,9 +89,19 @@ "end": "\\}", "patterns": [ { + "include": "#object-contents" + } + ] + }, + "object-contents": { + "patterns": [ + { "include": "$self" }, { + "include": "#object" + }, + { "include": "#signal" }, { @@ -299,16 +309,19 @@ ], "repository": { "attr-object": { - "begin": "\\b([\\w\\.]*)\\s*:\\s*(?=[A-Z]\\w*\\s*\\{)", + "begin": "\\b([\\w\\.]*)\\s*:\\s*([A-Z]\\w*\\s*\\{)", "beginCaptures": { "1": { "name": "variable.parameter.attr-object.qml" + }, + "2": { + "name": "variable.parameter.attr-object.type.qml" } }, - "end": "(?=\\})", + "end": "\\}", "patterns": [ { - "include": "#object" + "include": "#object-contents" } ] }, |
