diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-10-28 18:40:29 -0700 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2024-10-30 08:39:10 +0100 |
| commit | f26b5fb2edcf3700ea36637935566cab6f845f10 (patch) | |
| tree | 4c651103d436605c1bbe97290017de0d08811d63 | |
| parent | feat(bash): highlight more builtin commands (diff) | |
| download | nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.tar nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.tar.gz nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.tar.bz2 nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.tar.lz nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.tar.xz nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.tar.zst nvim-treesitter-f26b5fb2edcf3700ea36637935566cab6f845f10.zip | |
feat(thrift): small improvements
Less capture duplication by separating queries, include folds, move
`@variable.member` to `@property`
| -rw-r--r-- | queries/thrift/folds.scm | 1 | ||||
| -rw-r--r-- | queries/thrift/highlights.scm | 30 |
2 files changed, 12 insertions, 19 deletions
diff --git a/queries/thrift/folds.scm b/queries/thrift/folds.scm index 3beec3567..62880f98c 100644 --- a/queries/thrift/folds.scm +++ b/queries/thrift/folds.scm @@ -8,4 +8,5 @@ (struct_definition) (union_definition) (comment) + (include_statement)+ ] @fold diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm index 6d81291b3..96136d7b5 100644 --- a/queries/thrift/highlights.scm +++ b/queries/thrift/highlights.scm @@ -14,7 +14,7 @@ ; Fields (field - (identifier) @variable.member) + (identifier) @property) ; Parameters (function_definition @@ -67,17 +67,15 @@ (#lua-match? @constant "^[_A-Z][A-Z0-9_]*$")) (enum_definition - "enum" - . - (identifier) @type + type: (identifier) @type) + +(enum_definition "{" - (identifier) @constant - "}") + (identifier) @constant) ; Builtin Types -(primitive) @type.builtin - [ + (primitive) "list" "map" "set" @@ -88,9 +86,12 @@ ; Namespace (namespace_declaration - (namespace_scope) @string.special + (namespace_scope) @string.special) + +(namespace_declaration + (namespace_scope) [ - (namespace) @module + type: (namespace) @module (_ (identifier) @module) ]) @@ -205,19 +206,10 @@ [ "{" "}" -] @punctuation.bracket - -[ "(" ")" -] @punctuation.bracket - -[ "[" "]" -] @punctuation.bracket - -[ "<" ">" ] @punctuation.bracket |
