Skip to content

Commit 6b262b5

Browse files
committed
refactor(langserver): remove unused semantic token types and update regression tests
1 parent 96ba516 commit 6b262b5

File tree

233 files changed

+224427
-144699
lines changed

Some content is hidden

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

233 files changed

+224427
-144699
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,13 @@
448448
"editor.semanticTokenColorCustomizations": {
449449
"rules": {
450450
"*.documentation:robotframework": {
451-
"fontStyle": "italic"
451+
"italic": true
452452
},
453453
"*.embedded:robotframework": {
454-
"fontStyle": "italic"
454+
"italic": true
455+
},
456+
"*.builtin:robotframework": {
457+
"italic": true
455458
}
456459
}
457460
}
@@ -512,9 +515,6 @@
512515
"argument": [
513516
"string.unquoted.argument.robotframework"
514517
],
515-
"embeddedArgument": [
516-
"string.unquoted.embeddedArgument.robotframework"
517-
],
518518
"variable": [
519519
"variable.name.readwrite.robotframework"
520520
],
@@ -2116,4 +2116,4 @@
21162116
"workspaces": [
21172117
"docs"
21182118
]
2119-
}
2119+
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def _cached_unescape(token_value: str) -> str:
111111

112112

113113
class RobotSemTokenTypes(Enum):
114-
SECTION = "section"
115114
SETTING_IMPORT = "settingImport"
116115
SETTING = "setting"
117116
HEADER = "header"
@@ -125,7 +124,6 @@ class RobotSemTokenTypes(Enum):
125124
KEYWORD_NAME = "keywordName"
126125
CONTROL_FLOW = "controlFlow"
127126
ARGUMENT = "argument"
128-
EMBEDDED_ARGUMENT = "embeddedArgument"
129127
VARIABLE = "variable"
130128
KEYWORD = "keywordCall"
131129
KEYWORD_INNER = "keywordCallInner"
@@ -1156,9 +1154,9 @@ def generate_sem_sub_tokens(
11561154
if token.type in [Token.DOCUMENTATION, Token.METADATA]:
11571155
sem_mod = {SemanticTokenModifiers.DOCUMENTATION}
11581156

1159-
if token.type in [Token.VARIABLE, Token.ASSIGN]:
1160-
# TODO: maybe we can distinguish between local and global variables, by default all variables are global
1161-
pass
1157+
# TODO: maybe we can distinguish between local and global variables, by default all variables are global
1158+
# if token.type in [Token.VARIABLE, Token.ASSIGN]:
1159+
# pass
11621160

11631161
elif token.type in [Token.KEYWORD, ROBOT_KEYWORD_INNER] or (
11641162
token.type == Token.NAME and cached_isinstance(node, Fixture, Template, TestTemplate)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ result: !SemanticTokens
33
- 0
44
- 0
55
- 16
6-
- 27
6+
- 26
77
- 0
88
- 1
99
- 0
1010
- 8
11-
- 24
11+
- 23
1212
- 0
1313
- 0
1414
- 12
1515
- 22
16-
- 53
16+
- 51
1717
- 0
1818
- 2
1919
- 0
2020
- 11
21-
- 25
21+
- 24
2222
- 0
2323
- 0
2424
- 14
2525
- 26
26-
- 39
26+
- 37
2727
- 0
2828
result_id: null

0 commit comments

Comments
 (0)