Skip to content

Commit c4cfdb9

Browse files
committed
fix: correct highlightning *** Tasks *** and *** Settings ***
1 parent 607cf8d commit c4cfdb9

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
}
138138
},
139139
{
140-
"scope": "keyword.other.header.setting.robotframework",
140+
"scope": "keyword.other.header.settings.robotframework",
141141
"settings": {
142142
"fontStyle": "bold underline"
143143
}
@@ -155,13 +155,13 @@
155155
}
156156
},
157157
{
158-
"scope": "keyword.other.header.keyword.robotframework",
158+
"scope": "keyword.other.header.task.robotframework",
159159
"settings": {
160160
"fontStyle": "bold underline"
161161
}
162162
},
163163
{
164-
"scope": "keyword.other.header.setting.robotframework",
164+
"scope": "keyword.other.header.keyword.robotframework",
165165
"settings": {
166166
"fontStyle": "bold underline"
167167
}
@@ -214,6 +214,9 @@
214214
"headerTestcase": [
215215
"keyword.other.header.testcase.robotframework"
216216
],
217+
"headerTask": [
218+
"keyword.other.header.task.robotframework"
219+
],
217220
"setting": [
218221
"keyword.control.settings.robotframework"
219222
],

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class RobotSemTokenTypes(Enum):
7777
HEADER_SETTINGS = "headerSettings"
7878
HEADER_VARIABLE = "headerVariable"
7979
HEADER_TESTCASE = "headerTestcase"
80+
HEADER_TASK = "headerTask"
8081
HEADER_COMMENT = "headerComment"
8182
HEADER_KEYWORD = "headerKeyword"
8283
TESTCASE_NAME = "testcaseName"
@@ -231,6 +232,15 @@ def generate_mapping(cls) -> Dict[str, Tuple[Enum, Optional[Set[Enum]]]]:
231232
): (RobotSemTokenTypes.CONFIG, None),
232233
}
233234
)
235+
definition.update(
236+
{
237+
frozenset(
238+
{
239+
RobotToken.TASK_HEADER,
240+
}
241+
): (RobotSemTokenTypes.HEADER_TASK, None),
242+
}
243+
)
234244

235245
result: Dict[str, Tuple[Enum, Optional[Set[Enum]]]] = {}
236246
for k, v in definition.items():

tests/robotcode/language_server/robotframework/parts/data/robot.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ paths = ["."]
33
python-path = ["./lib", "./resources"]
44
output-dir = { expr = "f'results/run-{datetime.now().strftime(\"%d-%m-%Y-%H.%M.%S\")}'" }
55

6-
rpa = false
6+
# rpa = false
77
# [parsers]
88
# myparser = ["asd"]
99

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
*** Tasks ***
22
first task
3-
Fatal Error
3+
No Operation
4+
5+
second task
6+
No Operation

0 commit comments

Comments
 (0)