Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit e1d73eb

Browse files
committed
Provide highlighting for translation comments.
Close #115.
1 parent b5f91f4 commit e1d73eb

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Text {
2+
id: txt1;
3+
// This user interface string is only used here
4+
//: The back of the object, not the front
5+
//= qtn_foo_bar
6+
//~ Context Not related to back-stepping
7+
text: qsTr("Back");
8+
}

syntaxes/qml.tmLanguage.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,23 @@
260260
},
261261
"comment": {
262262
"patterns": [
263+
{
264+
"begin": "(\\/\\/[~|=])\\s*([A-Za-z_$][\\w$.\\[\\]]*)",
265+
"beginCaptures": {
266+
"1": {
267+
"name": "storage.type.class.qml.tr"
268+
},
269+
"2": {
270+
"name": "variable.other.qml.tr"
271+
}
272+
},
273+
"end": "$",
274+
"patterns": [
275+
{
276+
"include": "#comment-contents"
277+
}
278+
]
279+
},
263280
{
264281
"begin": "(\\/\\/)",
265282
"beginCaptures": {

0 commit comments

Comments
 (0)