Skip to content

Commit 170287d

Browse files
committed
fix(vscode): corrected highlightning of bold/italic in documentation tags
1 parent 39fad12 commit 170287d

File tree

4 files changed

+162
-125
lines changed

4 files changed

+162
-125
lines changed

syntaxes/codeblock_robotframework.tmLanguage.json

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,26 @@
11
{
2-
"fileTypes": [],
2+
"fileTypes": [ ],
33
"injectionSelector": "L:text.html.markdown",
44
"patterns": [
5-
{
6-
"include": "#robotframework-code-block"
7-
}
5+
{ "include": "#robotframework-code-block" }
86
],
97
"repository": {
108
"robotframework-code-block": {
119
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(robot|robotframework)(\\s+[^`~]*)?$)",
1210
"name": "markup.fenced_code.block.markdown",
1311
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
1412
"beginCaptures": {
15-
"3": {
16-
"name": "punctuation.definition.markdown"
17-
},
18-
"4": {
19-
"name": "fenced_code.block.language.markdown"
20-
},
21-
"5": {
22-
"name": "fenced_code.block.language.attributes.markdown"
23-
}
24-
},
25-
"endCaptures": {
26-
"3": {
27-
"name": "punctuation.definition.markdown"
28-
}
13+
"3": { "name": "punctuation.definition.markdown" },
14+
"4": { "name": "fenced_code.block.language.markdown" },
15+
"5": { "name": "fenced_code.block.language.attributes.markdown" }
2916
},
17+
"endCaptures": { "3": { "name": "punctuation.definition.markdown" } },
3018
"patterns": [
3119
{
3220
"begin": "(^|\\G)(\\s*)(.*)",
3321
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
3422
"contentName": "meta.embedded.block.robotframework",
35-
"patterns": [
36-
{
37-
"include": "source.robotframework"
38-
}
39-
]
23+
"patterns": [ { "include": "source.robotframework" } ]
4024
}
4125
]
4226
}

syntaxes/robotframework-repl.tmLanguage.json

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -132,34 +132,42 @@
132132
]
133133
},
134134
"documentation_bold": {
135-
"contentName": "markup.bold.documentation.robotframework",
136-
"begin": "(\\*)(\\**)",
137-
"end": "(\\*)*(\\*)|$",
138-
"beginCaptures": { "1": { "name": "markup.robotframework" } },
139-
"endCaptures": { "2": { "name": "markup.robotframework" } },
140-
"patterns": [
141-
{ "include": "#documentation_italic" },
142-
{ "include": "#escape" },
143-
{ "include": "#comment" },
144-
{ "include": "#comment_line" },
145-
{ "include": "#variables" },
146-
{ "include": "#line_continuation" }
147-
]
135+
"match": "(?:(?<=\\s|^))(\\*)(?:(?=\\S))(.*?)(?:(?<=\\S))(\\*)(?:(?=\\s|_))",
136+
"captures": {
137+
"1": { "name": "punctuation.definition.italic.markdown" },
138+
"2": {
139+
"name": "markup.bold.documentation.robotframework",
140+
"patterns": [
141+
{ "include": "#documentation_italic" },
142+
{ "include": "#documentation_bold" },
143+
{ "include": "#escape" },
144+
{ "include": "#comment" },
145+
{ "include": "#comment_line" },
146+
{ "include": "#variables" },
147+
{ "include": "#line_continuation" }
148+
]
149+
},
150+
"3": { "name": "punctuation.definition.italic.markdown" }
151+
}
148152
},
149153
"documentation_italic": {
150-
"contentName": "markup.italic.documentation.robotframework",
151-
"begin": "(_)(_*)",
152-
"end": "(_*)(_)|$",
153-
"beginCaptures": { "1": { "name": "markup.robotframework" } },
154-
"endCaptures": { "2": { "name": "markup.robotframework" } },
155-
"patterns": [
156-
{ "include": "#documentation_bold" },
157-
{ "include": "#escape" },
158-
{ "include": "#comment" },
159-
{ "include": "#comment_line" },
160-
{ "include": "#variables" },
161-
{ "include": "#line_continuation" }
162-
]
154+
"match": "(?:(?<=\\s|^))(_)(?:(?=\\S))(.*?)(?:(?<=\\S))(_)(?:(?=\\s|\\*))",
155+
"captures": {
156+
"1": { "name": "punctuation.definition.italic.markdown" },
157+
"2": {
158+
"name": "markup.italic.documentation.robotframework",
159+
"patterns": [
160+
{ "include": "#documentation_italic" },
161+
{ "include": "#documentation_bold" },
162+
{ "include": "#escape" },
163+
{ "include": "#comment" },
164+
{ "include": "#comment_line" },
165+
{ "include": "#variables" },
166+
{ "include": "#line_continuation" }
167+
]
168+
},
169+
"3": { "name": "punctuation.definition.italic.markdown" }
170+
}
163171
},
164172
"testcase_name": {
165173
"contentName": "string.unquoted.argument.robotframework",
@@ -389,11 +397,12 @@
389397
"contentName": "string.unquoted.argument.robotframework",
390398
"begin": "^(?:\\s*)([$@&]{(\\s?[^\\s|\\}](\\s?[^\\s|\\}]+?)*)*\\s?}(\\s?\\[(\\s?[^\\s|\\]](\\s?[^\\s|\\]]+?)*)*\\s?\\])*)( ?=?)(?: {2,}| ?\\t ?)(\\S(\\s?\\S)*)",
391399
"beginCaptures": {
392-
"1": {
393-
"patterns": [ { "include": "#variables" } ]
394-
},
400+
"1": { "patterns": [ { "include": "#variables" } ] },
395401
"7": { "name": "keyword.operator.robotframework" },
396-
"8": { "name": "entity.name.function.keyword-call.robotframework", "patterns": [ { "include": "#variables" } ] }
402+
"8": {
403+
"name": "entity.name.function.keyword-call.robotframework",
404+
"patterns": [ { "include": "#variables" } ]
405+
}
397406
},
398407
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
399408
"patterns": [

syntaxes/robotframework.tmLanguage.json

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"begin": "^([$@&]\\{)(.*?)(\\})( ?=?)",
88
"beginCaptures": {
99
"1": { "name": "punctuation.definition.variable.begin.robotframework" },
10-
"2": { "name": "variable.name.readwrite.robotframework", "patterns": [{"include": "#variables"}] },
10+
"2": {
11+
"name": "variable.name.readwrite.robotframework",
12+
"patterns": [ { "include": "#variables" } ]
13+
},
1114
"3": { "name": "punctuation.definition.variable.end.robotframework" },
1215
"4": { "name": "keyword.operator.robotframework" }
1316
},
@@ -129,39 +132,52 @@
129132
]
130133
},
131134
"documentation_bold": {
132-
"contentName": "markup.bold.documentation.robotframework",
133-
"begin": "(\\*)(\\**)",
134-
"end": "(\\*)*(\\*)|$",
135-
"beginCaptures": { "1": { "name": "markup.robotframework" } },
136-
"endCaptures": { "2": { "name": "markup.robotframework" } },
137-
"patterns": [
138-
{ "include": "#documentation_italic" },
139-
{ "include": "#escape" },
140-
{ "include": "#comment" },
141-
{ "include": "#comment_line" },
142-
{ "include": "#variables" },
143-
{ "include": "#line_continuation" }
144-
]
135+
"match": "(?:(?<=\\s|^))(\\*)(?:(?=\\S))(.*?)(?:(?<=\\S))(\\*)(?:(?=\\s|_))",
136+
"captures": {
137+
"1": { "name": "punctuation.definition.italic.markdown" },
138+
"2": {
139+
"name": "markup.bold.documentation.robotframework",
140+
"patterns": [
141+
{ "include": "#documentation_italic" },
142+
{ "include": "#documentation_bold" },
143+
{ "include": "#escape" },
144+
{ "include": "#comment" },
145+
{ "include": "#comment_line" },
146+
{ "include": "#variables" },
147+
{ "include": "#line_continuation" }
148+
]
149+
},
150+
"3": { "name": "punctuation.definition.italic.markdown" }
151+
}
145152
},
146153
"documentation_italic": {
147-
"contentName": "markup.italic.documentation.robotframework",
148-
"begin": "(_)(_*)",
149-
"end": "(_*)(_)|$",
150-
"beginCaptures": { "1": { "name": "markup.robotframework" } },
151-
"endCaptures": { "2": { "name": "markup.robotframework" } },
152-
"patterns": [
153-
{ "include": "#documentation_bold" },
154-
{ "include": "#escape" },
155-
{ "include": "#comment" },
156-
{ "include": "#comment_line" },
157-
{ "include": "#variables" },
158-
{ "include": "#line_continuation" }
159-
]
154+
"match": "(?:(?<=\\s|^))(_)(?:(?=\\S))(.*?)(?:(?<=\\S))(_)(?:(?=\\s|\\*))",
155+
"captures": {
156+
"1": { "name": "punctuation.definition.italic.markdown" },
157+
"2": {
158+
"name": "markup.italic.documentation.robotframework",
159+
"patterns": [
160+
{ "include": "#documentation_italic" },
161+
{ "include": "#documentation_bold" },
162+
{ "include": "#escape" },
163+
{ "include": "#comment" },
164+
{ "include": "#comment_line" },
165+
{ "include": "#variables" },
166+
{ "include": "#line_continuation" }
167+
]
168+
},
169+
"3": { "name": "punctuation.definition.italic.markdown" }
170+
}
160171
},
161172
"testcase_name": {
162173
"contentName": "string.unquoted.argument.robotframework",
163174
"begin": "^( ?\\S+( ?\\S*)*?)(?= {2}| ?\\t| ?$)",
164-
"beginCaptures": { "1": { "name": "entity.name.function.testcase.name.robotframework", "patterns": [{"include": "#variables"}] } },
175+
"beginCaptures": {
176+
"1": {
177+
"name": "entity.name.function.testcase.name.robotframework",
178+
"patterns": [ { "include": "#variables" } ]
179+
}
180+
},
165181
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
166182
"patterns": [
167183
{ "include": "#escape" },
@@ -174,7 +190,12 @@
174190
"keyword_name": {
175191
"contentName": "string.unquoted.argument.robotframework",
176192
"begin": "^( ?\\S+( ?\\S*)*?)(?= {2}| ?\\t| ?$)",
177-
"beginCaptures": { "1": { "name": "entity.name.function.keyword.name.robotframework", "patterns": [{"include": "#only_dollar_var"}] } },
193+
"beginCaptures": {
194+
"1": {
195+
"name": "entity.name.function.keyword.name.robotframework",
196+
"patterns": [ { "include": "#only_dollar_var" } ]
197+
}
198+
},
178199
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
179200
"patterns": [
180201
{ "include": "#escape" },
@@ -313,7 +334,12 @@
313334
"contentName": "string.unquoted.argument.robotframework",
314335
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(.*?)(?= {2,}| ?\\t ?| ?$)",
315336
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
316-
"beginCaptures": { "1": { "name": "entity.name.function.keyword-call.robotframework", "patterns": [{"include": "#variables"}]} },
337+
"beginCaptures": {
338+
"1": {
339+
"name": "entity.name.function.keyword-call.robotframework",
340+
"patterns": [ { "include": "#variables" } ]
341+
}
342+
},
317343
"patterns": [
318344
{ "include": "#escape" },
319345
{ "include": "#comment" },
@@ -381,9 +407,7 @@
381407
"contentName": "string.unquoted.argument.robotframework",
382408
"begin": "(?<=\\s)(?=\\s*(?:(?=[$@&])))((?:\\s)*(?:[$&@]{(?:.*?)}(?:\\[.*?\\])?(?: ?=?\\s*))*)(.*?)(?: {2,}| ?\\t ?|$)",
383409
"beginCaptures": {
384-
"1": {
385-
"patterns": [ { "include": "#variable_assignment_from_kw" } ]
386-
},
410+
"1": { "patterns": [ { "include": "#variable_assignment_from_kw" } ] },
387411
"2": { "name": "entity.name.function.keyword-call.robotframework" }
388412
},
389413
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
@@ -398,9 +422,7 @@
398422
"begin": "(?<=^\\s)(?:\\s*)(?=[$@&])",
399423
"end": "(?:( ?=)|(?: {2,}| ?\\t+ ?| ?$)(?![#$@& \\n\\r]|\\.\\.\\.)|^(?=\\.\\.\\.)( {2,}| ?\\t+ ?| ?$)(?![#$@&]))",
400424
"endCaptures": { "1": { "name": "keyword.operator.robotframework" } },
401-
"patterns": [
402-
{ "include": "#variables" }
403-
]
425+
"patterns": [ { "include": "#variables" } ]
404426
},
405427
"line_continuation": {
406428
"match": "^(\\s*\\.\\.\\.)(?! ?\\S)",

0 commit comments

Comments
 (0)