mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
fix(tiger): adjust invalid queries
This commit is contained in:
parent
6e3f888dc7
commit
b8e3b03748
9 changed files with 41 additions and 36 deletions
|
|
@ -16,9 +16,4 @@
|
|||
(method_declaration)
|
||||
] @fold
|
||||
|
||||
[
|
||||
(comment)
|
||||
(string_literal)
|
||||
] @ignore
|
||||
|
||||
; vim: sw=2 foldmethod=marker
|
||||
|
|
|
|||
|
|
@ -2,15 +2,21 @@
|
|||
((function_call
|
||||
function: (identifier) @function.builtin)
|
||||
(#match? @function.builtin "^(chr|concat|exit|flush|getchar|not|ord|print|print_err|print_int|size|strcmp|streq|substring)$")
|
||||
(#is-not? local))
|
||||
; FIXME: not supported by neovim
|
||||
; (#is-not? local)
|
||||
)
|
||||
|
||||
((type_identifier) @type.builtin
|
||||
(#match? @type.builtin "^(int|string|Object)$")
|
||||
(#is-not? local))
|
||||
; FIXME: not supported by neovim
|
||||
; (#is-not? local)
|
||||
)
|
||||
|
||||
((identifier) @variable.builtin
|
||||
(#match? @variable.builtin "^self$")
|
||||
(#is-not? local))
|
||||
; FIXME: not supported by neovim
|
||||
; (#is-not? local)
|
||||
)
|
||||
; }}}
|
||||
|
||||
; Keywords {{{
|
||||
|
|
@ -24,15 +30,15 @@
|
|||
"for"
|
||||
"to"
|
||||
"while"
|
||||
] @keyword.repeat
|
||||
] @repeat
|
||||
|
||||
[
|
||||
"new"
|
||||
] @keyword.constructor
|
||||
] @constructor
|
||||
|
||||
[
|
||||
"method"
|
||||
] @keyword.method
|
||||
] @method
|
||||
|
||||
[
|
||||
"array"
|
||||
|
|
@ -101,12 +107,12 @@
|
|||
name: (identifier) @method)
|
||||
|
||||
(parameters
|
||||
name: (identifier) @variable.parameter)
|
||||
name: (identifier) @parameter)
|
||||
; }}}
|
||||
|
||||
; Declarations {{{
|
||||
(import_declaration
|
||||
file: (string_literal) @string.special.path)
|
||||
file: (string_literal) @string.special)
|
||||
; }}}
|
||||
|
||||
; Literals {{{
|
||||
|
|
|
|||
|
|
@ -9,27 +9,31 @@
|
|||
(for_expression)
|
||||
(let_expression)
|
||||
(function_declaration)
|
||||
] @local.scope
|
||||
] @scope
|
||||
; }}}
|
||||
|
||||
; Definitions {{{
|
||||
(type_declaration
|
||||
name: (identifier) @local.definition)
|
||||
name: (identifier) @definition.type
|
||||
(#set! "definition.var.scope" "parent"))
|
||||
|
||||
(parameters
|
||||
name: (identifier) @local.definition)
|
||||
name: (identifier) @definition.parameter)
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @local.definition)
|
||||
name: (identifier) @definition.function
|
||||
(#set! "definition.var.scope" "parent"))
|
||||
(primitive_declaration
|
||||
name: (identifier) @local.definition)
|
||||
name: (identifier) @definition.function
|
||||
(#set! "definition.var.scope" "parent"))
|
||||
|
||||
(variable_declaration
|
||||
name: (identifier) @local.definition)
|
||||
name: (identifier) @definition.var
|
||||
(#set! "definition.var.scope" "parent"))
|
||||
; }}}
|
||||
|
||||
; References {{{
|
||||
(identifier) @local.reference
|
||||
(identifier) @reference
|
||||
; }}}
|
||||
|
||||
; vim: sw=2 foldmethod=marker
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue