Skip to content

Commit 43321f6

Browse files
committed
fix(vscode): some small corrections for in (semantic) highlightning
1 parent 8a1e91e commit 43321f6

File tree

57 files changed

+386
-386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+386
-386
lines changed

packages/language_server/src/robotcode/language_server/robotframework/parts/semantic_tokens.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
Fixture,
2727
KeywordCall,
2828
LibraryImport,
29+
Metadata,
2930
ResourceImport,
3031
Statement,
3132
Template,
@@ -234,7 +235,7 @@ def generate_mapping(cls) -> Dict[str, Tuple[Enum, Optional[Set[Enum]]]]:
234235
None,
235236
),
236237
frozenset({ROBOT_OPERATOR}): (SemanticTokenTypes.OPERATOR, None),
237-
frozenset({Token.NAME}): (RobotSemTokenTypes.NAME, None),
238+
frozenset({Token.NAME}): (RobotSemTokenTypes.ARGUMENT, None),
238239
frozenset({Token.CONTINUATION}): (
239240
RobotSemTokenTypes.CONTINUATION,
240241
None,
@@ -593,7 +594,7 @@ def generate_sem_sub_tokens(
593594
1,
594595
)
595596
else:
596-
if token.type != Token.ARGUMENT:
597+
if token.type != Token.ARGUMENT or token.type != Token.NAME and isinstance(node, Metadata):
597598
yield SemTokenInfo.from_token(token, sem_type, sem_mod, col_offset, length)
598599

599600
def generate_sem_tokens(

syntaxes/robotframework.tmLanguage.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"documentation_setting": {
106106
"contentName": "markup.robotframework",
107107
"begin": "(?i)^(documentation|dokumentation|Tài liệu hướng dẫn)(?= {2}| ?\\t| ?$)",
108-
"beginCaptures": { "1": { "name": "keyword.control.global.settings.documentation.robotframework" } },
108+
"beginCaptures": { "1": { "name": "keyword.control.settings.robotframework" } },
109109
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
110110
"patterns": [
111111
{ "include": "#comment" },
@@ -217,15 +217,14 @@
217217
"other_setting": {
218218
"contentName": "string.unquoted.argument.robotframework",
219219
"begin": "(?i)^(\\S+( \\S+)*)(?= {2}| ?\\t| ?$)",
220-
"beginCaptures": { "1": { "name": "keyword.control.global.settings.robotframework" } },
220+
"beginCaptures": { "1": { "name": "keyword.control.settings.robotframework" } },
221221
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
222222
"patterns": [
223-
{ "include": "#testcase_settings" },
224-
{ "include": "#control_flow_expression_statements" },
225-
{ "include": "#control_flow_statements" },
226-
{ "include": "#other_statements" },
227-
{ "include": "#keyword_call" },
228-
{ "include": "#returning_keyword_call" }
223+
{ "include": "#escape" },
224+
{ "include": "#comment" },
225+
{ "include": "#comment_line" },
226+
{ "include": "#variables" },
227+
{ "include": "#line_continuation" }
229228
]
230229
},
231230
"unknown_setting": {
@@ -327,7 +326,7 @@
327326
"contentName": "string.unquoted.argument.robotframework",
328327
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(VAR)(?= {2,}| ?\\t ?| ?$)",
329328
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
330-
"beginCaptures": { "1": { "name": "keyword.robotframework" } },
329+
"beginCaptures": { "1": { "name": "keyword.other.robotframework" } },
331330
"patterns": [
332331
{ "include": "#escape" },
333332
{ "include": "#comment" },

tests/robotcode/language_server/robotframework/parts/_regtest_outputs/rf41/test_semantic_tokens.test[__init__.robot].out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ result: !SemanticTokens
2323
- 0
2424
- 14
2525
- 26
26-
- 42
26+
- 36
2727
- 0
2828
result_id: null

tests/robotcode/language_server/robotframework/parts/_regtest_outputs/rf41/test_semantic_tokens.test[code_action_show_documentation.robot].out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ result: !SemanticTokens
253253
- 0
254254
- 1
255255
- 14
256-
- 42
256+
- 36
257257
- 1024
258258
- 1
259259
- 0
@@ -273,7 +273,7 @@ result: !SemanticTokens
273273
- 0
274274
- 14
275275
- 14
276-
- 42
276+
- 36
277277
- 1024
278278
- 1
279279
- 0
@@ -348,7 +348,7 @@ result: !SemanticTokens
348348
- 0
349349
- 5
350350
- 14
351-
- 42
351+
- 36
352352
- 1024
353353
- 0
354354
- 21
@@ -398,7 +398,7 @@ result: !SemanticTokens
398398
- 0
399399
- 1
400400
- 14
401-
- 42
401+
- 36
402402
- 1024
403403
- 0
404404
- 21
@@ -533,7 +533,7 @@ result: !SemanticTokens
533533
- 0
534534
- 5
535535
- 14
536-
- 42
536+
- 36
537537
- 1024
538538
- 1
539539
- 0
@@ -578,7 +578,7 @@ result: !SemanticTokens
578578
- 0
579579
- 1
580580
- 14
581-
- 42
581+
- 36
582582
- 1024
583583
- 1
584584
- 0
@@ -723,7 +723,7 @@ result: !SemanticTokens
723723
- 0
724724
- 5
725725
- 13
726-
- 42
726+
- 36
727727
- 0
728728
- 0
729729
- 13
@@ -758,7 +758,7 @@ result: !SemanticTokens
758758
- 0
759759
- 5
760760
- 13
761-
- 42
761+
- 36
762762
- 0
763763
- 0
764764
- 13

tests/robotcode/language_server/robotframework/parts/_regtest_outputs/rf41/test_semantic_tokens.test[document_highlight.robot].out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ result: !SemanticTokens
253253
- 0
254254
- 1
255255
- 14
256-
- 42
256+
- 36
257257
- 1024
258258
- 1
259259
- 0
@@ -278,7 +278,7 @@ result: !SemanticTokens
278278
- 0
279279
- 14
280280
- 14
281-
- 42
281+
- 36
282282
- 1024
283283
- 1
284284
- 0
@@ -373,7 +373,7 @@ result: !SemanticTokens
373373
- 0
374374
- 5
375375
- 14
376-
- 42
376+
- 36
377377
- 1024
378378
- 0
379379
- 21
@@ -428,7 +428,7 @@ result: !SemanticTokens
428428
- 0
429429
- 1
430430
- 14
431-
- 42
431+
- 36
432432
- 1024
433433
- 0
434434
- 21
@@ -618,7 +618,7 @@ result: !SemanticTokens
618618
- 0
619619
- 5
620620
- 14
621-
- 42
621+
- 36
622622
- 1024
623623
- 1
624624
- 0
@@ -668,7 +668,7 @@ result: !SemanticTokens
668668
- 0
669669
- 1
670670
- 14
671-
- 42
671+
- 36
672672
- 1024
673673
- 1
674674
- 0

tests/robotcode/language_server/robotframework/parts/_regtest_outputs/rf41/test_semantic_tokens.test[goto.robot].out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ result: !SemanticTokens
11631163
- 0
11641164
- 5
11651165
- 3
1166-
- 42
1166+
- 36
11671167
- 1024
11681168
- 1
11691169
- 0
@@ -1203,7 +1203,7 @@ result: !SemanticTokens
12031203
- 0
12041204
- 1
12051205
- 3
1206-
- 42
1206+
- 36
12071207
- 1024
12081208
- 1
12091209
- 0
@@ -1258,7 +1258,7 @@ result: !SemanticTokens
12581258
- 0
12591259
- 1
12601260
- 3
1261-
- 42
1261+
- 36
12621262
- 1024
12631263
- 1
12641264
- 0

tests/robotcode/language_server/robotframework/parts/_regtest_outputs/rf41/test_semantic_tokens.test[hover.robot].out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ result: !SemanticTokens
848848
- 0
849849
- 3
850850
- 3
851-
- 42
851+
- 36
852852
- 1024
853853
- 0
854854
- 13
@@ -898,7 +898,7 @@ result: !SemanticTokens
898898
- 0
899899
- 1
900900
- 3
901-
- 42
901+
- 36
902902
- 1024
903903
- 0
904904
- 13
@@ -1378,7 +1378,7 @@ result: !SemanticTokens
13781378
- 0
13791379
- 1
13801380
- 3
1381-
- 42
1381+
- 36
13821382
- 1024
13831383
- 1
13841384
- 0
@@ -1873,12 +1873,12 @@ result: !SemanticTokens
18731873
- 0
18741874
- 5
18751875
- 1
1876-
- 42
1876+
- 36
18771877
- 0
18781878
- 0
18791879
- 1
18801880
- 3
1881-
- 42
1881+
- 36
18821882
- 1024
18831883
- 1
18841884
- 0
@@ -1923,7 +1923,7 @@ result: !SemanticTokens
19231923
- 0
19241924
- 4
19251925
- 1
1926-
- 42
1926+
- 36
19271927
- 0
19281928
- 0
19291929
- 1
@@ -1938,7 +1938,7 @@ result: !SemanticTokens
19381938
- 0
19391939
- 1
19401940
- 3
1941-
- 42
1941+
- 36
19421942
- 1024
19431943
- 1
19441944
- 0
@@ -2453,12 +2453,12 @@ result: !SemanticTokens
24532453
- 0
24542454
- 5
24552455
- 1
2456-
- 42
2456+
- 36
24572457
- 0
24582458
- 0
24592459
- 1
24602460
- 3
2461-
- 42
2461+
- 36
24622462
- 1024
24632463
- 4
24642464
- 0

tests/robotcode/language_server/robotframework/parts/_regtest_outputs/rf41/test_semantic_tokens.test[references.robot].out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ result: !SemanticTokens
273273
- 0
274274
- 1
275275
- 14
276-
- 42
276+
- 36
277277
- 1024
278278
- 1
279279
- 0
@@ -298,7 +298,7 @@ result: !SemanticTokens
298298
- 0
299299
- 14
300300
- 14
301-
- 42
301+
- 36
302302
- 1024
303303
- 1
304304
- 0
@@ -403,7 +403,7 @@ result: !SemanticTokens
403403
- 0
404404
- 5
405405
- 14
406-
- 42
406+
- 36
407407
- 1024
408408
- 0
409409
- 21
@@ -458,7 +458,7 @@ result: !SemanticTokens
458458
- 0
459459
- 1
460460
- 14
461-
- 42
461+
- 36
462462
- 1024
463463
- 0
464464
- 21
@@ -648,7 +648,7 @@ result: !SemanticTokens
648648
- 0
649649
- 5
650650
- 14
651-
- 42
651+
- 36
652652
- 1024
653653
- 1
654654
- 0
@@ -698,7 +698,7 @@ result: !SemanticTokens
698698
- 0
699699
- 1
700700
- 14
701-
- 42
701+
- 36
702702
- 1024
703703
- 1
704704
- 0
@@ -873,7 +873,7 @@ result: !SemanticTokens
873873
- 0
874874
- 5
875875
- 13
876-
- 42
876+
- 36
877877
- 0
878878
- 0
879879
- 13
@@ -913,7 +913,7 @@ result: !SemanticTokens
913913
- 0
914914
- 5
915915
- 13
916-
- 42
916+
- 36
917917
- 0
918918
- 0
919919
- 13
@@ -2758,7 +2758,7 @@ result: !SemanticTokens
27582758
- 0
27592759
- 5
27602760
- 3
2761-
- 42
2761+
- 36
27622762
- 1024
27632763
- 0
27642764
- 7

0 commit comments

Comments
 (0)