From 644e0ac872244f30da6a5cfa6115962cd0b0ad40 Mon Sep 17 00:00:00 2001 From: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com> Date: Wed, 23 Nov 2022 02:09:54 -0800 Subject: [PATCH] Fix syntax highlighting for strings with double-colons (#278) --- language/ahk.tmLanguage.yaml | 2 +- .../samples/54-double-colon-in-string.ahk | 3 +++ .../54-double-colon-in-string.ahk.snap | 27 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/test/suite/grammar/samples/54-double-colon-in-string.ahk create mode 100644 src/test/suite/grammar/samples/54-double-colon-in-string.ahk.snap diff --git a/language/ahk.tmLanguage.yaml b/language/ahk.tmLanguage.yaml index 30463a2c..1066d9aa 100644 --- a/language/ahk.tmLanguage.yaml +++ b/language/ahk.tmLanguage.yaml @@ -73,7 +73,7 @@ repository: name: entity.name.function.label.ahk '2': name: punctuation.definition.equals.colon - match: ^\s*(.+)(::) + match: ^\s*([^\"]+)(::) name: hotkeyline.ahk example: '^c::' function-call: diff --git a/src/test/suite/grammar/samples/54-double-colon-in-string.ahk b/src/test/suite/grammar/samples/54-double-colon-in-string.ahk new file mode 100644 index 00000000..6133872e --- /dev/null +++ b/src/test/suite/grammar/samples/54-double-colon-in-string.ahk @@ -0,0 +1,3 @@ +;[#54 in AHK+](https://github.com/vscode-autohotkey/autohotkey-plus/issues/54) +Hotstring("::ykhis", "you know how it is") +Hotstring(":C:OOS", "out-of::-spec") \ No newline at end of file diff --git a/src/test/suite/grammar/samples/54-double-colon-in-string.ahk.snap b/src/test/suite/grammar/samples/54-double-colon-in-string.ahk.snap new file mode 100644 index 00000000..e74e8bfb --- /dev/null +++ b/src/test/suite/grammar/samples/54-double-colon-in-string.ahk.snap @@ -0,0 +1,27 @@ +>;[#54 in AHK+](https://github.com/vscode-autohotkey/autohotkey-plus/issues/54) +#^ source.ahk comment.line.semicolon.ahk punctuation.definition.comment.ahk +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.ahk comment.line.semicolon.ahk +>Hotstring("::ykhis", "you know how it is") +#^^^^^^^^^ source.ahk entity.name.function.ahk +# ^ source.ahk punctuation.bracket.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.begin.ahk +# ^^^^^^^ source.ahk string.quoted.double.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.end.ahk +# ^ source.ahk punctuation.ahk +# ^ source.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.begin.ahk +# ^^^^^^^^^^^^^^^^^^ source.ahk string.quoted.double.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.end.ahk +# ^ source.ahk punctuation.bracket.ahk +>Hotstring(":C:OOS", "out-of::-spec") +#^^^^^^^^^ source.ahk entity.name.function.ahk +# ^ source.ahk punctuation.bracket.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.begin.ahk +# ^^^^^^ source.ahk string.quoted.double.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.end.ahk +# ^ source.ahk punctuation.ahk +# ^ source.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.begin.ahk +# ^^^^^^^^^^^^^ source.ahk string.quoted.double.ahk +# ^ source.ahk string.quoted.double.ahk punctuation.definition.string.end.ahk +# ^ source.ahk punctuation.bracket.ahk \ No newline at end of file