Skip to content

Commit

Permalink
fix(vscode): corrected highlightning of bold/italic in documentation …
Browse files Browse the repository at this point in the history
…tags
  • Loading branch information
d-biehl committed Dec 5, 2024
1 parent 39fad12 commit 170287d
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 125 deletions.
30 changes: 7 additions & 23 deletions syntaxes/codeblock_robotframework.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,26 @@
{
"fileTypes": [],
"fileTypes": [ ],
"injectionSelector": "L:text.html.markdown",
"patterns": [
{
"include": "#robotframework-code-block"
}
{ "include": "#robotframework-code-block" }
],
"repository": {
"robotframework-code-block": {
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(robot|robotframework)(\\s+[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
"3": { "name": "punctuation.definition.markdown" },
"4": { "name": "fenced_code.block.language.markdown" },
"5": { "name": "fenced_code.block.language.attributes.markdown" }
},
"endCaptures": { "3": { "name": "punctuation.definition.markdown" } },
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.robotframework",
"patterns": [
{
"include": "source.robotframework"
}
]
"patterns": [ { "include": "source.robotframework" } ]
}
]
}
Expand Down
69 changes: 39 additions & 30 deletions syntaxes/robotframework-repl.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,34 +132,42 @@
]
},
"documentation_bold": {
"contentName": "markup.bold.documentation.robotframework",
"begin": "(\\*)(\\**)",
"end": "(\\*)*(\\*)|$",
"beginCaptures": { "1": { "name": "markup.robotframework" } },
"endCaptures": { "2": { "name": "markup.robotframework" } },
"patterns": [
{ "include": "#documentation_italic" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
"match": "(?:(?<=\\s|^))(\\*)(?:(?=\\S))(.*?)(?:(?<=\\S))(\\*)(?:(?=\\s|_))",
"captures": {
"1": { "name": "punctuation.definition.italic.markdown" },
"2": {
"name": "markup.bold.documentation.robotframework",
"patterns": [
{ "include": "#documentation_italic" },
{ "include": "#documentation_bold" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
},
"3": { "name": "punctuation.definition.italic.markdown" }
}
},
"documentation_italic": {
"contentName": "markup.italic.documentation.robotframework",
"begin": "(_)(_*)",
"end": "(_*)(_)|$",
"beginCaptures": { "1": { "name": "markup.robotframework" } },
"endCaptures": { "2": { "name": "markup.robotframework" } },
"patterns": [
{ "include": "#documentation_bold" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
"match": "(?:(?<=\\s|^))(_)(?:(?=\\S))(.*?)(?:(?<=\\S))(_)(?:(?=\\s|\\*))",
"captures": {
"1": { "name": "punctuation.definition.italic.markdown" },
"2": {
"name": "markup.italic.documentation.robotframework",
"patterns": [
{ "include": "#documentation_italic" },
{ "include": "#documentation_bold" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
},
"3": { "name": "punctuation.definition.italic.markdown" }
}
},
"testcase_name": {
"contentName": "string.unquoted.argument.robotframework",
Expand Down Expand Up @@ -389,11 +397,12 @@
"contentName": "string.unquoted.argument.robotframework",
"begin": "^(?:\\s*)([$@&]{(\\s?[^\\s|\\}](\\s?[^\\s|\\}]+?)*)*\\s?}(\\s?\\[(\\s?[^\\s|\\]](\\s?[^\\s|\\]]+?)*)*\\s?\\])*)( ?=?)(?: {2,}| ?\\t ?)(\\S(\\s?\\S)*)",
"beginCaptures": {
"1": {
"patterns": [ { "include": "#variables" } ]
},
"1": { "patterns": [ { "include": "#variables" } ] },
"7": { "name": "keyword.operator.robotframework" },
"8": { "name": "entity.name.function.keyword-call.robotframework", "patterns": [ { "include": "#variables" } ] }
"8": {
"name": "entity.name.function.keyword-call.robotframework",
"patterns": [ { "include": "#variables" } ]
}
},
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
"patterns": [
Expand Down
94 changes: 58 additions & 36 deletions syntaxes/robotframework.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"begin": "^([$@&]\\{)(.*?)(\\})( ?=?)",
"beginCaptures": {
"1": { "name": "punctuation.definition.variable.begin.robotframework" },
"2": { "name": "variable.name.readwrite.robotframework", "patterns": [{"include": "#variables"}] },
"2": {
"name": "variable.name.readwrite.robotframework",
"patterns": [ { "include": "#variables" } ]
},
"3": { "name": "punctuation.definition.variable.end.robotframework" },
"4": { "name": "keyword.operator.robotframework" }
},
Expand Down Expand Up @@ -129,39 +132,52 @@
]
},
"documentation_bold": {
"contentName": "markup.bold.documentation.robotframework",
"begin": "(\\*)(\\**)",
"end": "(\\*)*(\\*)|$",
"beginCaptures": { "1": { "name": "markup.robotframework" } },
"endCaptures": { "2": { "name": "markup.robotframework" } },
"patterns": [
{ "include": "#documentation_italic" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
"match": "(?:(?<=\\s|^))(\\*)(?:(?=\\S))(.*?)(?:(?<=\\S))(\\*)(?:(?=\\s|_))",
"captures": {
"1": { "name": "punctuation.definition.italic.markdown" },
"2": {
"name": "markup.bold.documentation.robotframework",
"patterns": [
{ "include": "#documentation_italic" },
{ "include": "#documentation_bold" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
},
"3": { "name": "punctuation.definition.italic.markdown" }
}
},
"documentation_italic": {
"contentName": "markup.italic.documentation.robotframework",
"begin": "(_)(_*)",
"end": "(_*)(_)|$",
"beginCaptures": { "1": { "name": "markup.robotframework" } },
"endCaptures": { "2": { "name": "markup.robotframework" } },
"patterns": [
{ "include": "#documentation_bold" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
"match": "(?:(?<=\\s|^))(_)(?:(?=\\S))(.*?)(?:(?<=\\S))(_)(?:(?=\\s|\\*))",
"captures": {
"1": { "name": "punctuation.definition.italic.markdown" },
"2": {
"name": "markup.italic.documentation.robotframework",
"patterns": [
{ "include": "#documentation_italic" },
{ "include": "#documentation_bold" },
{ "include": "#escape" },
{ "include": "#comment" },
{ "include": "#comment_line" },
{ "include": "#variables" },
{ "include": "#line_continuation" }
]
},
"3": { "name": "punctuation.definition.italic.markdown" }
}
},
"testcase_name": {
"contentName": "string.unquoted.argument.robotframework",
"begin": "^( ?\\S+( ?\\S*)*?)(?= {2}| ?\\t| ?$)",
"beginCaptures": { "1": { "name": "entity.name.function.testcase.name.robotframework", "patterns": [{"include": "#variables"}] } },
"beginCaptures": {
"1": {
"name": "entity.name.function.testcase.name.robotframework",
"patterns": [ { "include": "#variables" } ]
}
},
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
"patterns": [
{ "include": "#escape" },
Expand All @@ -174,7 +190,12 @@
"keyword_name": {
"contentName": "string.unquoted.argument.robotframework",
"begin": "^( ?\\S+( ?\\S*)*?)(?= {2}| ?\\t| ?$)",
"beginCaptures": { "1": { "name": "entity.name.function.keyword.name.robotframework", "patterns": [{"include": "#only_dollar_var"}] } },
"beginCaptures": {
"1": {
"name": "entity.name.function.keyword.name.robotframework",
"patterns": [ { "include": "#only_dollar_var" } ]
}
},
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
"patterns": [
{ "include": "#escape" },
Expand Down Expand Up @@ -313,7 +334,12 @@
"contentName": "string.unquoted.argument.robotframework",
"begin": "^(?!(?: {2,}| ?\\t ?)+(?:(?=[$\\[@&%]|\\.)))(?: {2,}| ?\\t ?)+(.*?)(?= {2,}| ?\\t ?| ?$)",
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
"beginCaptures": { "1": { "name": "entity.name.function.keyword-call.robotframework", "patterns": [{"include": "#variables"}]} },
"beginCaptures": {
"1": {
"name": "entity.name.function.keyword-call.robotframework",
"patterns": [ { "include": "#variables" } ]
}
},
"patterns": [
{ "include": "#escape" },
{ "include": "#comment" },
Expand Down Expand Up @@ -381,9 +407,7 @@
"contentName": "string.unquoted.argument.robotframework",
"begin": "(?<=\\s)(?=\\s*(?:(?=[$@&])))((?:\\s)*(?:[$&@]{(?:.*?)}(?:\\[.*?\\])?(?: ?=?\\s*))*)(.*?)(?: {2,}| ?\\t ?|$)",
"beginCaptures": {
"1": {
"patterns": [ { "include": "#variable_assignment_from_kw" } ]
},
"1": { "patterns": [ { "include": "#variable_assignment_from_kw" } ] },
"2": { "name": "entity.name.function.keyword-call.robotframework" }
},
"end": "^(?!(\\s*(\\.\\.\\.((( {2}| ?\\t)\\s*\\S.*)|(\\s*))?$))|(\\s*#.*$)|(\\s*$))",
Expand All @@ -398,9 +422,7 @@
"begin": "(?<=^\\s)(?:\\s*)(?=[$@&])",
"end": "(?:( ?=)|(?: {2,}| ?\\t+ ?| ?$)(?![#$@& \\n\\r]|\\.\\.\\.)|^(?=\\.\\.\\.)( {2,}| ?\\t+ ?| ?$)(?![#$@&]))",
"endCaptures": { "1": { "name": "keyword.operator.robotframework" } },
"patterns": [
{ "include": "#variables" }
]
"patterns": [ { "include": "#variables" } ]
},
"line_continuation": {
"match": "^(\\s*\\.\\.\\.)(?! ?\\S)",
Expand Down
Loading

0 comments on commit 170287d

Please sign in to comment.