mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(thrift): improve queries
This commit is contained in:
parent
17d7cf6f4b
commit
93386fc725
5 changed files with 57 additions and 2 deletions
|
|
@ -1323,6 +1323,7 @@ list.thrift = {
|
|||
install_info = {
|
||||
url = "https://github.com/duskmoon314/tree-sitter-thrift",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main",
|
||||
},
|
||||
maintainers = { "@amaanq", "@duskmoon314" },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
[
|
||||
(annotation)
|
||||
(enum)
|
||||
(exception)
|
||||
(function)
|
||||
(senum)
|
||||
(service)
|
||||
(struct)
|
||||
(union)
|
||||
|
||||
(function_parameters)
|
||||
(exception_parameters)
|
||||
(comment)
|
||||
] @fold
|
||||
|
|
|
|||
20
queries/thrift/indents.scm
Normal file
20
queries/thrift/indents.scm
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(definition) @indent
|
||||
|
||||
; (function (function_identifier) @aligned_indent)
|
||||
|
||||
((function_parameters (function_parameter)) @aligned_indent
|
||||
(#set! "delimiter" "()"))
|
||||
|
||||
((exception_parameters (exception_parameter)) @aligned_indent
|
||||
(#set! "delimiter" "()"))
|
||||
|
||||
"}" @indent_end
|
||||
|
||||
[ "{" "}" ] @branch
|
||||
|
||||
[ "(" ")" ] @branch
|
||||
|
||||
[
|
||||
(ERROR)
|
||||
(comment)
|
||||
] @auto
|
||||
1
queries/thrift/injections.scm
Normal file
1
queries/thrift/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(comment) @comment
|
||||
32
queries/thrift/locals.scm
Normal file
32
queries/thrift/locals.scm
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
(document) @scope
|
||||
(definition) @scope
|
||||
|
||||
[
|
||||
(identifier)
|
||||
(field_type)
|
||||
(custom_type)
|
||||
] @reference
|
||||
(const_value (const_identifier) @reference)
|
||||
|
||||
(annotation_identifier) @definition
|
||||
|
||||
(const (const_identifier) @definition.constant)
|
||||
(enum_member) @definition.constant
|
||||
|
||||
(enum_identifier) @definition.enum
|
||||
|
||||
(field_identifier) @definition.field
|
||||
|
||||
(function_identifier) @definition.function
|
||||
|
||||
(namespace_definition) @definition.namespace
|
||||
|
||||
[
|
||||
(param_identifier)
|
||||
(exception_param_identifier)
|
||||
] @definition.parameter
|
||||
|
||||
[
|
||||
(type_identifier)
|
||||
(exception_identifier)
|
||||
] @definition.type
|
||||
Loading…
Add table
Add a link
Reference in a new issue