diff options
| author | maxxnino <34153891+maxxnino@users.noreply.github.com> | 2021-11-21 14:42:32 +0900 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2021-11-23 16:46:27 +0100 |
| commit | ff2897e5b7ca8b4ce188696995c3b325a2f16412 (patch) | |
| tree | a904dd99fca24194f97493f756c7189f37e3c4ba | |
| parent | Prefer lua-match over match (diff) | |
| download | nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.tar nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.tar.gz nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.tar.bz2 nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.tar.lz nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.tar.xz nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.tar.zst nvim-treesitter-ff2897e5b7ca8b4ce188696995c3b325a2f16412.zip | |
zig: highlight zig format, type and function
| -rw-r--r-- | queries/zig/highlights.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm index 7dde682ca..b85b4d369 100644 --- a/queries/zig/highlights.scm +++ b/queries/zig/highlights.scm @@ -4,6 +4,10 @@ (line_comment) ] @comment +((line_comment) @text.note + (#match? @text.note "^// *zig fmt: (on|off) *$") +) + [ variable: (IDENTIFIER) variable_type_function: (IDENTIFIER) @@ -23,7 +27,7 @@ parameter: (IDENTIFIER) @parameter field_access: (IDENTIFIER) parameter: (IDENTIFIER) ] @type - (#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$") + (#match? @type "^[A-Z]") ) ;; assume camelCase is a function ( @@ -32,7 +36,7 @@ parameter: (IDENTIFIER) @parameter field_access: (IDENTIFIER) parameter: (IDENTIFIER) ] @function - (#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$") + (#match? @function "^[a-z]+[A-Z]+") ) ;; assume all CAPS_1 is a constant |
