Skip to content

Commit c274c51

Browse files
committed
fix(vscode): correct highlightning of line continuations if it contains empty lines or comments lines
fixes: #263
1 parent 1ded4d0 commit c274c51

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

syntaxes/robotframework.tmLanguage.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"3": { "name": "punctuation.definition.variable.end.robotframework" },
1616
"4": { "name": "keyword.operator.robotframework" }
1717
},
18-
"end": "^(?!\\s*\\.\\.\\.)",
18+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
1919
"patterns": [
2020
{ "include": "#escape" },
2121
{ "include": "#comment" },
@@ -91,7 +91,7 @@
9191
"contentName": "markup.robotframework",
9292
"begin": "(?i)^(documentation|dokumentation|Tài liệu hướng dẫn)(?= {2}| ?\\t| ?$)",
9393
"beginCaptures": { "1": { "name": "keyword.control.settings.robotframework" } },
94-
"end": "^(?!\\s*\\.\\.\\.)",
94+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
9595
"patterns": [
9696
{ "include": "#documentation_italic" },
9797
{ "include": "#documentation_bold" },
@@ -135,7 +135,7 @@
135135
"contentName": "string.unquoted.argument.robotframework",
136136
"begin": "(?i)^(\\S+( \\S+)*)(?= {2}| ?\\t| ?$)",
137137
"beginCaptures": { "1": { "name": "keyword.control.settings.robotframework" } },
138-
"end": "^(?!\\s*\\.\\.\\.)",
138+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
139139
"patterns": [
140140
{ "include": "#escape" },
141141
{ "include": "#comment" },
@@ -153,7 +153,7 @@
153153
"contentName": "markup.robotframework",
154154
"begin": "(?i)(\\[(documentation|dokumentation|Tài liệu hướng dẫn)\\])(?= {2}| ?\\t| ?$)",
155155
"beginCaptures": { "0": { "name": "keyword.control.settings.robotframework" } },
156-
"end": "^(?!\\s*\\.\\.\\.)",
156+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
157157
"patterns": [
158158
{ "include": "#documentation_italic" },
159159
{ "include": "#documentation_bold" },
@@ -167,7 +167,7 @@
167167
"contentName": "string.unquoted.argument.robotframework",
168168
"begin": "(\\[.*?\\])(?= {2}| ?\\t| ?$)",
169169
"beginCaptures": { "0": { "name": "keyword.control.settings.robotframework" } },
170-
"end": "^(?!\\s*\\.\\.\\.)",
170+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
171171
"patterns": [
172172
{ "include": "#escape" },
173173
{ "include": "#comment" },
@@ -179,7 +179,7 @@
179179
"name": "meta.keyword-call.content.robotframework",
180180
"contentName": "string.unquoted.argument.robotframework",
181181
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(.*?)(?= {2,}| ?\\t ?| ?$)",
182-
"end": "^(?!\\s*\\.\\.\\.)",
182+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
183183
"beginCaptures": { "1": { "name": "entity.name.function.keyword-call.robotframework" } },
184184
"patterns": [
185185
{ "include": "#comment" },
@@ -191,7 +191,7 @@
191191
"name": "meta.keyword-call.content.robotframework",
192192
"contentName": "string.unquoted.argument.robotframework",
193193
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(IF|ELSE IF|WHILE)(( {2,}| ?\\t)( *)(.*?))?(?= {2,}| ?\\t ?| ?$)",
194-
"end": "^(?!\\s*\\.\\.\\.)",
194+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
195195
"beginCaptures": {
196196
"1": { "name": "keyword.control.flow.robotframework" },
197197
"5": {
@@ -209,7 +209,7 @@
209209
"name": "meta.keyword-call.content.robotframework",
210210
"contentName": "string.unquoted.argument.robotframework",
211211
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(FOR|END|ELSE|TRY|EXCEPT|FINALLY)(?= {2,}| ?\\t ?| ?$)",
212-
"end": "^(?!\\s*\\.\\.\\.)",
212+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
213213
"beginCaptures": { "1": { "name": "keyword.control.flow.robotframework" } },
214214
"patterns": [
215215
{ "include": "#comment" },
@@ -221,7 +221,7 @@
221221
"name": "meta.keyword-call.content.robotframework",
222222
"contentName": "string.unquoted.argument.robotframework",
223223
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(VAR)(?= {2,}| ?\\t ?| ?$)",
224-
"end": "^(?!\\s*\\.\\.\\.)",
224+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
225225
"beginCaptures": { "1": { "name": "keyword.robotframework" } },
226226
"patterns": [
227227
{ "include": "#comment" },
@@ -233,7 +233,7 @@
233233
"name": "meta.returning-keyword-call.robotframework",
234234
"contentName": "meta.returning.keyword.content.robotframework",
235235
"begin": "^(?=(?: {2,}| ?\\t ?)+(?:(?=[$@&])))(?:\\s)",
236-
"end": "^(?!\\s*\\.\\.\\.)",
236+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
237237
"patterns": [ { "include": "#returning_keyword" } ]
238238
},
239239
"returning_keyword": {
@@ -247,7 +247,7 @@
247247
},
248248
"2": { "name": "entity.name.function.keyword-call.robotframework" }
249249
},
250-
"end": "^(?!\\s*\\.\\.\\.)",
250+
"end": "^(?!(\\s*\\.\\.\\.)|(\\s+)|(\\s*#\\.*))",
251251
"patterns": [
252252
{ "include": "#variables" },
253253
{ "include": "#line_continuation" },
@@ -266,7 +266,11 @@
266266
},
267267
"line_continuation": {
268268
"match": "^(\\s*\\.\\.\\.)(?: {2,}| ?\\t+| ?$)",
269-
"name": "keyword.operator.robotframework"
269+
"captures": {
270+
"1": {
271+
"name": "keyword.operator.continue.robotframework"
272+
}
273+
}
270274
},
271275
"impossible": {
272276
"comment": "This is a special rule that should be used where no match is desired. It is not a good idea to match something like '1{0}' because in some cases that can result in infinite loops in token generation. So the rule instead matches and impossible expression to allow a match to fail and move to the next token.",

0 commit comments

Comments
 (0)