Skip to content

Commit 1f73179

Browse files
committed
Inherit microprofile-config TextMate language from vscode-microprofile
Signed-off-by: David Thompson <[email protected]>
1 parent 4e8ff3c commit 1f73179

File tree

3 files changed

+76
-3
lines changed

3 files changed

+76
-3
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"scopeName": "quarkus-value.injection",
3+
"injectionSelector": "L:string.unquoted.java-properties",
4+
"patterns": [
5+
{
6+
"include": "#numbers"
7+
},
8+
{
9+
"include": "#expression"
10+
}
11+
],
12+
"repository": {
13+
"numbers": {
14+
"patterns": [
15+
{
16+
"match": "(?x)\n\\b(?<!\\$)\n0(x|X)\n(\n (?<!\\.)[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?[Ll]?(?!\\.)\n |\n (\n [0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?\\.?\n |\n ([0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?)?\\.[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?\n )\n [Pp][+-]?[0-9]([0-9_]*[0-9])?[FfDd]?\n)\n\\b(?!\\$)",
17+
"name": "constant.numeric.hex.java-properties"
18+
},
19+
{
20+
"match": "\\b(?<!\\$)0(b|B)[01]([01_]*[01])?[Ll]?\\b(?!\\$)",
21+
"name": "constant.numeric.binary.java-properties"
22+
},
23+
{
24+
"match": "\\b(?<!\\$)0[0-7]([0-7_]*[0-7])?[Ll]?\\b(?!\\$)",
25+
"name": "constant.numeric.octal.java-properties"
26+
},
27+
{
28+
"match": "(?x)\n(?<!\\$)\n(\n \\b[0-9]([0-9_]*[0-9])?\\.\\B(?!\\.)\n |\n \\b[0-9]([0-9_]*[0-9])?\\.([Ee][+-]?[0-9]([0-9_]*[0-9])?)[FfDd]?\\b\n |\n \\b[0-9]([0-9_]*[0-9])?\\.([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]\\b\n |\n \\b[0-9]([0-9_]*[0-9])?\\.([0-9]([0-9_]*[0-9])?)([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]?\\b\n |\n (?<!\\.)\\B\\.[0-9]([0-9_]*[0-9])?([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]?\\b\n |\n \\b[0-9]([0-9_]*[0-9])?([Ee][+-]?[0-9]([0-9_]*[0-9])?)[FfDd]?\\b\n |\n \\b[0-9]([0-9_]*[0-9])?([Ee][+-]?[0-9]([0-9_]*[0-9])?)?[FfDd]\\b\n |\n \\b(0|[1-9]([0-9_]*[0-9])?)(?!\\.)[Ll]?\\b\n)\n(?!\\$)",
29+
"name": "constant.numeric.decimal.java-properties"
30+
}
31+
]
32+
},
33+
"expression": {
34+
"comment": "Matching for expression. Ex : ${expression:value} ${my.prop${compose}} ${my.prop}${my.prop}",
35+
"begin": "(\\$\\{)",
36+
"beginCaptures": {
37+
"1": {
38+
"name": "support.function.java-properties"
39+
}
40+
},
41+
"end": "(\\})",
42+
"endCaptures": {
43+
"1": {
44+
"name": "support.function.java-properties"
45+
}
46+
},
47+
"patterns": [
48+
{
49+
"match": "(?<=\\{)([a-zA-z.]+)",
50+
"name": "support.type.name.java-properties"
51+
},
52+
{
53+
"match": "(:)",
54+
"name": "keyword.operator.assign.value.java-properties"
55+
},
56+
{
57+
"match": "(?<=\\:)([a-zA-z0-9]+)",
58+
"name": "variable.other.value.java-properties"
59+
},
60+
{
61+
"include": "#expression"
62+
}
63+
]
64+
}
65+
}
66+
}

language-support/properties-support/quarkus-properties.tmLanguage.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"scopeName": "source.quarkus-properties",
44
"patterns": [
55
{
6-
"comment": "source.java-properties is defined in vscode-microprofile",
7-
"include": "source.java-properties"
6+
"comment": "source.microprofile-properties is defined in vscode-microprofile",
7+
"include": "source.microprofile-properties"
88
}
99
],
1010
"uuid": "924b3a76-ca9c-11ea-87d0-0242ac130003"
11-
}
11+
}

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,13 @@
379379
"scopeName": "source.quarkus-properties",
380380
"path": "./language-support/properties-support/quarkus-properties.tmLanguage.json"
381381
},
382+
{
383+
"injectTo": [
384+
"source.quarkus-properties"
385+
],
386+
"scopeName": "quarkus-value.injection",
387+
"path": "./language-support/properties-support/quarkus-properties-injection.tmLanguage.json"
388+
},
382389
{
383390
"language": "qute-html",
384391
"scopeName": "text.html.qute",

0 commit comments

Comments
 (0)