forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add highlight support for tree-sitter-query language (tsq) (helix-edi…
…tor#845) * add submodule on tree-sitter/tree-sitter-tsq mark tsq submodule as shallow * add tree-sitter-tsq to languages * add highlight queries for tsq * Update .gitmodules Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
- Loading branch information
1 parent
4346592
commit e069fb9
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-tsq
added at
b66565
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
; mark the string passed #match? as a regex | ||
(((predicate_name) @function | ||
(capture) | ||
(string) @string.regexp) | ||
(#eq? @function "#match?")) | ||
|
||
; highlight inheritance comments | ||
((query . (comment) @keyword.directive) | ||
(#match? @keyword.directive "^;\ +inherits *:")) | ||
|
||
[ | ||
"(" | ||
")" | ||
"[" | ||
"]" | ||
] @punctuation.bracket | ||
|
||
":" @punctuation.delimiter | ||
|
||
[ | ||
(one_or_more) | ||
(zero_or_one) | ||
(zero_or_more) | ||
] @operator | ||
|
||
[ | ||
(wildcard_node) | ||
(anchor) | ||
] @constant.builtin | ||
|
||
[ | ||
(anonymous_leaf) | ||
(string) | ||
] @string | ||
|
||
(comment) @comment | ||
|
||
(field_name) @property | ||
|
||
(capture) @label | ||
|
||
(predicate_name) @function | ||
|
||
(escape_sequence) @escape | ||
|
||
(node_name) @variable |