Skip to content

Commit

Permalink
fix: correct highlightning *** Tasks *** and *** Settings ***
Browse files Browse the repository at this point in the history
  • Loading branch information
d-biehl committed Jun 13, 2023
1 parent 607cf8d commit c4cfdb9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}
},
{
"scope": "keyword.other.header.setting.robotframework",
"scope": "keyword.other.header.settings.robotframework",
"settings": {
"fontStyle": "bold underline"
}
Expand All @@ -155,13 +155,13 @@
}
},
{
"scope": "keyword.other.header.keyword.robotframework",
"scope": "keyword.other.header.task.robotframework",
"settings": {
"fontStyle": "bold underline"
}
},
{
"scope": "keyword.other.header.setting.robotframework",
"scope": "keyword.other.header.keyword.robotframework",
"settings": {
"fontStyle": "bold underline"
}
Expand Down Expand Up @@ -214,6 +214,9 @@
"headerTestcase": [
"keyword.other.header.testcase.robotframework"
],
"headerTask": [
"keyword.other.header.task.robotframework"
],
"setting": [
"keyword.control.settings.robotframework"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class RobotSemTokenTypes(Enum):
HEADER_SETTINGS = "headerSettings"
HEADER_VARIABLE = "headerVariable"
HEADER_TESTCASE = "headerTestcase"
HEADER_TASK = "headerTask"
HEADER_COMMENT = "headerComment"
HEADER_KEYWORD = "headerKeyword"
TESTCASE_NAME = "testcaseName"
Expand Down Expand Up @@ -231,6 +232,15 @@ def generate_mapping(cls) -> Dict[str, Tuple[Enum, Optional[Set[Enum]]]]:
): (RobotSemTokenTypes.CONFIG, None),
}
)
definition.update(
{
frozenset(
{
RobotToken.TASK_HEADER,
}
): (RobotSemTokenTypes.HEADER_TASK, None),
}
)

result: Dict[str, Tuple[Enum, Optional[Set[Enum]]]] = {}
for k, v in definition.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ paths = ["."]
python-path = ["./lib", "./resources"]
output-dir = { expr = "f'results/run-{datetime.now().strftime(\"%d-%m-%Y-%H.%M.%S\")}'" }

rpa = false
# rpa = false
# [parsers]
# myparser = ["asd"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*** Tasks ***
first task
Fatal Error
No Operation

second task
No Operation

0 comments on commit c4cfdb9

Please sign in to comment.