Skip to content

Commit fb4a0c9

Browse files
committed
Fixing bracket pair matching/ctrl+M navigation/code folding/surrounding bracket or quote typing
1 parent 2a5ff83 commit fb4a0c9

2 files changed

Lines changed: 107 additions & 63 deletions

File tree

language-configuration.json

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,63 @@
1-
[
2-
{
3-
"comments": {
4-
"lineComment": "//",
5-
"blockComment": [
6-
"/*",
7-
"*/"
8-
]
9-
},
10-
"brackets": [
11-
[
12-
"{",
13-
"}"
14-
],
15-
[
16-
"[",
17-
"]"
18-
],
19-
[
20-
"(",
21-
")"
22-
]
1+
{
2+
"comments": {
3+
"lineComment": "//",
4+
"blockComment": [
5+
"/*",
6+
"*/"
7+
]
8+
},
9+
"brackets": [
10+
[
11+
"{",
12+
"}"
2313
],
24-
"autoClosingPairs": [
25-
{
26-
"open": "(",
27-
"close": ")"
28-
},
29-
{
30-
"open": "[",
31-
"close": "]"
32-
},
33-
{
34-
"open": "{",
35-
"close": "}"
36-
},
37-
{
38-
"open": "\"",
39-
"close": "\"",
40-
"notIn": [
41-
"string",
42-
"comment"
43-
]
44-
}
14+
[
15+
"[",
16+
"]"
4517
],
46-
"surroundingPairs": [
47-
{
48-
"open": "(",
49-
"close": ")"
50-
},
51-
{
52-
"open": "[",
53-
"close": "]"
54-
},
55-
{
56-
"open": "{",
57-
"close": "}"
58-
},
59-
{
60-
"open": "\"",
61-
"close": "\""
62-
}
18+
[
19+
"(",
20+
")"
6321
]
64-
}
65-
]
22+
],
23+
"autoClosingPairs": [
24+
{
25+
"open": "(",
26+
"close": ")"
27+
},
28+
{
29+
"open": "[",
30+
"close": "]"
31+
},
32+
{
33+
"open": "{",
34+
"close": "}"
35+
},
36+
{
37+
"open": "\"",
38+
"close": "\"",
39+
"notIn": [
40+
"string",
41+
"comment"
42+
]
43+
}
44+
],
45+
"surroundingPairs": [
46+
{
47+
"open": "(",
48+
"close": ")"
49+
},
50+
{
51+
"open": "[",
52+
"close": "]"
53+
},
54+
{
55+
"open": "{",
56+
"close": "}"
57+
},
58+
{
59+
"open": "\"",
60+
"close": "\""
61+
}
62+
]
63+
}

syntaxes/usecode.tmLanguage.json

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{
1515
"include": "#directives"
1616
},
17+
{
18+
"include": "#generic-params"
19+
},
1720
{
1821
"include": "#keywords"
1922
},
@@ -264,7 +267,31 @@
264267
},
265268
{
266269
"name": "keyword.operator.usecode",
267-
"match": "(?:!|&|\\-|\\+|<|>|\\*|/|%|=|\\.|,|;|:|\\(|\\)|\\[|\\]|\\{|\\}|@)"
270+
"match": "(?:!|&|\\-|\\+|\\*|/|%|=|\\.|,|;|:|@)"
271+
},
272+
{
273+
"name": "punctuation.section.parens.begin.bracket.round.usecode",
274+
"match": "\\("
275+
},
276+
{
277+
"name": "punctuation.section.parens.end.bracket.round.usecode",
278+
"match": "\\)"
279+
},
280+
{
281+
"name": "punctuation.section.block.begin.bracket.square.usecode",
282+
"match": "\\["
283+
},
284+
{
285+
"name": "punctuation.section.block.end.bracket.square.usecode",
286+
"match": "\\]"
287+
},
288+
{
289+
"name": "punctuation.section.block.begin.bracket.curly.usecode",
290+
"match": "\\{"
291+
},
292+
{
293+
"name": "punctuation.section.block.end.bracket.curly.usecode",
294+
"match": "\\}"
268295
},
269296
{
270297
"name": "keyword.operator.usecode",
@@ -324,6 +351,25 @@
324351
}
325352
]
326353
},
354+
"generic-params": {
355+
"name": "meta.generic-parameters.usecode",
356+
"begin": "(\\b(?:class|struct)\\b)(\\s*)(<)",
357+
"beginCaptures": {
358+
"1": { "name": "storage.type.usecode" },
359+
"3": { "name": "punctuation.section.angle-brackets.begin.template.definition.usecode" }
360+
},
361+
"end": ">",
362+
"endCaptures": {
363+
"0": { "name": "punctuation.section.angle-brackets.end.template.definition.usecode" }
364+
},
365+
"patterns": [
366+
{
367+
"name": "entity.name.type.generic.usecode",
368+
"match": "\\s*([A-Za-z_][A-Za-z0-9_]*)\\s*"
369+
},
370+
{ "include": "#comments" }
371+
]
372+
},
327373
"idents": {
328374
"patterns": [
329375
{

0 commit comments

Comments
 (0)