Skip to content

Commit a2bfa5e

Browse files
committed
feat: Improve scope word highlighting in injection strings
1 parent fbb718a commit a2bfa5e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

language-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
],
5050
// "wordPattern" doesn't support `atomic` groups or `possessive quantifiers`, leading to catastrophic backtracking. Workaround is to use a lookahead, named-group and backreference /(?=(?<name>)...)\\k<name>/
5151
// "wordPattern" is used in reference for intellisense suggestion triggering, word highlighting and ctrl+hover definitions
52-
"wordPattern": "(?<=(^|(?<!\\\\)[\\[\\]{}:,\t])\\s*)(?=(?<json>[\\w/$]+))\\k<json>(?=\\s*($|[\\[\\]{}:,\"\t](?!\\\\)))|(?<=(?<!\\\\)[\" (]-?|\\b[LR]:)(?=(?<string>[a-zA-Z./$][\\w./$-]*[\\w.]))\\k<string>(?=[\" )])|(?<=(?<!\\\\)\")(?=(?<include>[\\w.#$-]+))\\k<include>(?=\")"
52+
"wordPattern": "(?<=(^|(?<!\\\\)[\\[\\]{}:,\t])\\s*)(?=(?<json>[\\w/$]+))\\k<json>(?=\\s*($|[\\[\\]{}:,\"\t](?!\\\\)))|(?<=(?<!\\\\)(?:[\" (]|\\\\.)-?|\\b[LR]:)(?=(?<string>[a-zA-Z./$][\\w./$-]*[\\w.]))\\k<string>(?=[\\\\\" )])|(?<=(?<!\\\\)\")(?=(?<include>[\\w.#$-]+))\\k<include>(?=\")"
5353
}

language-configurations/json.language-configuration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
["{", "}"],
3232
["[", "]"]
3333
],
34-
// "wordPattern" doesn't support `atomic` groups or `possessive quantifiers`, leading to catastrophic backtracking. Workaround is to use a lookahead and backreference /(?=(?<name>)...)\\k<name>/
34+
// "wordPattern" doesn't support `atomic` groups or `possessive quantifiers`, leading to catastrophic backtracking. Workaround is to use a lookahead, named-group and backreference /(?=(?<name>)...)\\k<name>/
3535
// "wordPattern" is used in reference for intellisense suggestion triggering, word highlighting and ctrl+hover definitions
36-
"wordPattern": "(?<=(^|(?<!\\\\)[\\[\\]{}:,\\t])\\s*)(?=(?<json>[\\w/$]+))\\k<json>(?=\\s*($|[\\[\\]{}:,\"\\t](?!\\\\)))|(?<=(?<!\\\\)[\"\\s]|\\b[LR]:)(?=(?<string>[a-zA-Z$/][\\w./$-]*\\w))\\k<string>(?=[\"\\s])|(?<=(?<!\\\\)\")(?!\")(?=(?<include>[\\w.$-]*#?[\\w.#$-]*))\\k<include>(?=\")"
36+
"wordPattern": "(?<=(^|(?<!\\\\)[\\[\\]{}:,\t])\\s*)(?=(?<json>[\\w/$]+))\\k<json>(?=\\s*($|[\\[\\]{}:,\"\t](?!\\\\)))|(?<=(?<!\\\\)(?:[\" (]|\\\\.)-?|\\b[LR]:)(?=(?<string>[a-zA-Z./$][\\w./$-]*[\\w.]))\\k<string>(?=[\\\\\" )])|(?<=(?<!\\\\)\")(?=(?<include>[\\w.#$-]+))\\k<include>(?=\")"
3737
}

0 commit comments

Comments
 (0)