File tree Expand file tree Collapse file tree 4 files changed +3769
-35
lines changed
packages/language_server/src/robotcode/language_server/robotframework/parts Expand file tree Collapse file tree 4 files changed +3769
-35
lines changed Original file line number Diff line number Diff line change 6
6
// symbols used as brackets
7
7
"brackets" : [
8
8
[" ${{" , " }}" ],
9
+ [" &{{" , " }}" ],
10
+ [" @{{" , " }}" ],
9
11
[" ${" , " }" ],
10
12
[" @{" , " }" ],
11
13
[" %{" , " }" ],
16
18
],
17
19
"colorizedBracketPairs" : [
18
20
[" ${{" , " }}" ],
21
+ [" &{{" , " }}" ],
22
+ [" @{{" , " }}" ],
19
23
[" ${" , " }" ],
20
24
[" @{" , " }" ],
21
25
[" %{" , " }" ],
27
31
// symbols that are auto closed when typing
28
32
"autoClosingPairs" : [
29
33
[" ${{" , " }}" ],
34
+ [" &{{" , " }}" ],
35
+ [" @{{" , " }}" ],
30
36
[" ${" , " }" ],
31
37
[" @{" , " }" ],
32
38
[" %{" , " }" ],
40
46
// symbols that can be used to surround a selection
41
47
"surroundingPairs" : [
42
48
[" ${{" , " }}" ],
49
+ [" &{{" , " }}" ],
50
+ [" @{{" , " }}" ],
43
51
[" ${" , " }" ],
44
52
[" @{" , " }" ],
45
53
[" %{" , " }" ],
Original file line number Diff line number Diff line change 269
269
"variable" : [
270
270
" variable.other.readwrite.robotframework"
271
271
],
272
+ "variableExpression" : [
273
+ " variable.expression.readwrite.robotframework"
274
+ ],
272
275
"keywordCall" : [
273
276
" entity.name.function.keyword-call.robotframework"
274
277
],
339
342
"scopeName" : " source.robotframework" ,
340
343
"path" : " ./syntaxes/robotframework.tmLanguage.json" ,
341
344
"tokenTypes" : {
342
- "string.unquoted.argument.robotframework" : " other"
343
- },
344
- "embeddedLanguages" : {
345
- "meta.expression.robotframework" : " python"
345
+ "string.unquoted.argument.robotframework" : " other" ,
346
+ "variable.expression.robotframework" : " other"
346
347
}
347
348
}
348
349
],
1481
1482
"webpack" : " ^5.90.3" ,
1482
1483
"webpack-cli" : " ^5.1.4"
1483
1484
}
1484
- }
1485
+ }
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ class RobotSemTokenTypes(Enum):
109
109
FOR_SEPARATOR = "forSeparator"
110
110
VARIABLE_BEGIN = "variableBegin"
111
111
VARIABLE_END = "variableEnd"
112
+ VARIABLE_EXPRESSION = "variableExpression"
112
113
ESCAPE = "escape"
113
114
NAMESPACE = "namespace"
114
115
ERROR = "error"
@@ -355,27 +356,30 @@ def generate_sem_sub_tokens(
355
356
length = token .end_col_offset - token .col_offset
356
357
357
358
last_index = token .value .rfind ("}" )
359
+
360
+ is_expr = token .value [1 :2 ] == "{" and token .value [last_index - 1 : last_index ] == "}"
361
+
358
362
if last_index >= 0 :
359
363
yield SemTokenInfo (
360
364
token .lineno ,
361
365
col_offset ,
362
- 2 ,
366
+ 3 if is_expr else 2 ,
363
367
RobotSemTokenTypes .VARIABLE_BEGIN ,
364
368
sem_mod ,
365
369
)
366
370
367
- yield SemTokenInfo .from_token (
368
- token ,
369
- sem_type ,
370
- sem_mod ,
371
- col_offset + 2 ,
372
- last_index - 2 ,
373
- )
371
+ # yield SemTokenInfo.from_token(
372
+ # token,
373
+ # RobotSemTokenTypes.VARIABLE_EXPRESSION if is_expr else sem_type,
374
+ # sem_mod,
375
+ # col_offset + (3 if is_expr else 2) ,
376
+ # last_index - (4 if is_expr else 2) ,
377
+ # )
374
378
375
379
yield SemTokenInfo (
376
380
token .lineno ,
377
- col_offset + last_index ,
378
- 1 ,
381
+ col_offset + (( last_index - 1 ) if is_expr else last_index ) ,
382
+ 2 if is_expr else 1 ,
379
383
RobotSemTokenTypes .VARIABLE_END ,
380
384
sem_mod ,
381
385
)
You can’t perform that action at this time.
0 commit comments