mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 17:30:08 -04:00
feat(thrift): small improvements
Less capture duplication by separating queries, include folds, move `@variable.member` to `@property`
This commit is contained in:
parent
0e65a9f272
commit
f26b5fb2ed
2 changed files with 12 additions and 19 deletions
|
|
@ -8,4 +8,5 @@
|
||||||
(struct_definition)
|
(struct_definition)
|
||||||
(union_definition)
|
(union_definition)
|
||||||
(comment)
|
(comment)
|
||||||
|
(include_statement)+
|
||||||
] @fold
|
] @fold
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
; Fields
|
; Fields
|
||||||
(field
|
(field
|
||||||
(identifier) @variable.member)
|
(identifier) @property)
|
||||||
|
|
||||||
; Parameters
|
; Parameters
|
||||||
(function_definition
|
(function_definition
|
||||||
|
|
@ -67,17 +67,15 @@
|
||||||
(#lua-match? @constant "^[_A-Z][A-Z0-9_]*$"))
|
(#lua-match? @constant "^[_A-Z][A-Z0-9_]*$"))
|
||||||
|
|
||||||
(enum_definition
|
(enum_definition
|
||||||
"enum"
|
type: (identifier) @type)
|
||||||
.
|
|
||||||
(identifier) @type
|
(enum_definition
|
||||||
"{"
|
"{"
|
||||||
(identifier) @constant
|
(identifier) @constant)
|
||||||
"}")
|
|
||||||
|
|
||||||
; Builtin Types
|
; Builtin Types
|
||||||
(primitive) @type.builtin
|
|
||||||
|
|
||||||
[
|
[
|
||||||
|
(primitive)
|
||||||
"list"
|
"list"
|
||||||
"map"
|
"map"
|
||||||
"set"
|
"set"
|
||||||
|
|
@ -88,9 +86,12 @@
|
||||||
|
|
||||||
; Namespace
|
; Namespace
|
||||||
(namespace_declaration
|
(namespace_declaration
|
||||||
(namespace_scope) @string.special
|
(namespace_scope) @string.special)
|
||||||
|
|
||||||
|
(namespace_declaration
|
||||||
|
(namespace_scope)
|
||||||
[
|
[
|
||||||
(namespace) @module
|
type: (namespace) @module
|
||||||
(_
|
(_
|
||||||
(identifier) @module)
|
(identifier) @module)
|
||||||
])
|
])
|
||||||
|
|
@ -205,19 +206,10 @@
|
||||||
[
|
[
|
||||||
"{"
|
"{"
|
||||||
"}"
|
"}"
|
||||||
] @punctuation.bracket
|
|
||||||
|
|
||||||
[
|
|
||||||
"("
|
"("
|
||||||
")"
|
")"
|
||||||
] @punctuation.bracket
|
|
||||||
|
|
||||||
[
|
|
||||||
"["
|
"["
|
||||||
"]"
|
"]"
|
||||||
] @punctuation.bracket
|
|
||||||
|
|
||||||
[
|
|
||||||
"<"
|
"<"
|
||||||
">"
|
">"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue