mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
feat(treesitter): bundle query parser and queries (#22483)
skip injections for now
This commit is contained in:
@ -11,10 +11,10 @@
|
||||
arguments: (arguments (string content: _ @vim)))
|
||||
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec" "vim.api.nvim_cmd"))
|
||||
|
||||
; ((function_call
|
||||
; name: (_) @_vimcmd_identifier
|
||||
; arguments: (arguments (string content: _ @query) .))
|
||||
; (#eq? @_vimcmd_identifier "vim.treesitter.query.set_query"))
|
||||
((function_call
|
||||
name: (_) @_vimcmd_identifier
|
||||
arguments: (arguments (string content: _ @query) .))
|
||||
(#eq? @_vimcmd_identifier "vim.treesitter.query.set_query"))
|
||||
|
||||
; ;; highlight string as query if starts with `;; query`
|
||||
; ((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
|
||||
|
6
runtime/queries/query/folds.scm
Normal file
6
runtime/queries/query/folds.scm
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
(named_node)
|
||||
(predicate)
|
||||
(grouping)
|
||||
(list)
|
||||
] @fold
|
34
runtime/queries/query/highlights.scm
Normal file
34
runtime/queries/query/highlights.scm
Normal file
@ -0,0 +1,34 @@
|
||||
(string) @string
|
||||
(escape_sequence) @string.escape
|
||||
(capture (identifier) @type)
|
||||
(anonymous_node (identifier) @string)
|
||||
(predicate name: (identifier) @function)
|
||||
(named_node name: (identifier) @variable)
|
||||
(field_definition name: (identifier) @property)
|
||||
(negated_field "!" @operator (identifier) @property)
|
||||
(comment) @comment @spell
|
||||
|
||||
(quantifier) @operator
|
||||
(predicate_type) @punctuation.special
|
||||
|
||||
"." @operator
|
||||
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
":" @punctuation.delimiter
|
||||
["@" "#"] @punctuation.special
|
||||
"_" @constant
|
||||
|
||||
((parameters (identifier) @number)
|
||||
(#match? @number "^[-+]?[0-9]+(.[0-9]+)?$"))
|
||||
|
||||
((program . (comment) @include)
|
||||
(#match? @include "^;\ +inherits\ *:"))
|
||||
|
||||
((program . (comment) @preproc)
|
||||
(#match? @preproc "^; +extends"))
|
@ -24,5 +24,5 @@
|
||||
"patchexpr" "pex"
|
||||
"charconvert" "ccv"))
|
||||
|
||||
(comment) @comment
|
||||
(line_continuation_comment) @comment
|
||||
; (comment) @comment
|
||||
; (line_continuation_comment) @comment
|
||||
|
Reference in New Issue
Block a user