diff --git a/CHANGELOG.md b/CHANGELOG.md index c55b8bc1f..fac0814d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ - Handle completion for DOM/element attributes and attribute values properly when using a generic JSX transform. https://github.com/rescript-lang/rescript-vscode/pull/919 - Highlight tagged template literal functions as functions. https://github.com/rescript-lang/rescript-vscode/pull/920 - Complete for `type t` values when encountering a `type t` in relevant scenarios. https://github.com/rescript-lang/rescript-vscode/pull/924 +- Highlight escaped sequences as a whole and not only the first character. https://github.com/rescript-lang/rescript-vscode/pull/929 +- Start highlighting escaped sequences in template literals. https://github.com/rescript-lang/rescript-vscode/pull/929 ## 1.38.0 diff --git a/grammars/rescript.tmLanguage.json b/grammars/rescript.tmLanguage.json index 3c3e6f0da..5990a9476 100644 --- a/grammars/rescript.tmLanguage.json +++ b/grammars/rescript.tmLanguage.json @@ -119,6 +119,10 @@ } ] }, + "string-character-escape": { + "name": "constant.character.escape", + "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u{[0-9A-Fa-f]+}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" + }, "string": { "patterns": [ { @@ -137,8 +141,7 @@ }, "patterns": [ { - "name": "constant.character.escape", - "match": "\\\\." + "include": "#string-character-escape" } ] }, @@ -160,6 +163,9 @@ } }, "patterns": [ + { + "include": "#string-character-escape" + }, { "name": "meta.template.expression", "begin": "\\$\\{", @@ -606,4 +612,4 @@ "include": "#defaultIdIsVariable" } ] -} \ No newline at end of file +}