Skip to content

Commit

Permalink
Fix syntax highlighting for strings with double-colons (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-wiemer authored Nov 23, 2022
1 parent 9337871 commit 644e0ac
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion language/ahk.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions src/test/suite/grammar/samples/54-double-colon-in-string.ahk
Original file line number Diff line number Diff line change
@@ -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")
27 changes: 27 additions & 0 deletions src/test/suite/grammar/samples/54-double-colon-in-string.ahk.snap
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 644e0ac

Please sign in to comment.