Update generated neovim config
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
[
|
||||
(ast_block)
|
||||
(list)
|
||||
(array)
|
||||
(expr)
|
||||
(json_array)
|
||||
(json_object)
|
||||
(parenthesized_expression)
|
||||
] @fold
|
||||
@ -0,0 +1,107 @@
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"||"
|
||||
"&&"
|
||||
"=="
|
||||
"!="
|
||||
"=~"
|
||||
">"
|
||||
"<"
|
||||
">="
|
||||
"<="
|
||||
"!"
|
||||
"?."
|
||||
"?:"
|
||||
] @operator
|
||||
|
||||
(ternary_expression
|
||||
["?" ":"] @operator)
|
||||
|
||||
; Punctuation
|
||||
|
||||
[ ":" "." "," ] @punctuation.delimiter
|
||||
|
||||
[ "{" "}" "[" "]" "(" ")" ] @punctuation.bracket
|
||||
|
||||
; Literals
|
||||
|
||||
(number (float)) @constant.numeric.float
|
||||
|
||||
(number (integer)) @constant.numeric.integer
|
||||
|
||||
(boolean) @constant.builtin.boolean
|
||||
|
||||
; Strings
|
||||
|
||||
(escape_sequence) @constant.character.escape
|
||||
|
||||
(string_interpolation
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special)
|
||||
|
||||
[ (string_fragment) "\"" "'" "`" ] @string
|
||||
|
||||
; Attributes & Fields
|
||||
|
||||
(keyword) @attribute
|
||||
|
||||
; Functions
|
||||
|
||||
(function_call
|
||||
name: (ident) @function.call)
|
||||
|
||||
; Variables
|
||||
|
||||
(ident) @variable
|
||||
|
||||
(array
|
||||
(symbol) @variable)
|
||||
|
||||
; Builtin widgets
|
||||
|
||||
(list .
|
||||
((symbol) @tag.builtin
|
||||
(#match? @tag.builtin "^(box|button|calendar|centerbox|checkbox|circular-progress|color-button|color-chooser|combo-box-text|eventbox|expander|graph|image|input|label|literal|overlay|progress|revealer|scale|scroll|transform)$")))
|
||||
|
||||
; Keywords
|
||||
|
||||
; I think there's a bug in tree-sitter the anchor doesn't seem to be working, see
|
||||
; https://github.com/tree-sitter/tree-sitter/pull/2107
|
||||
(list .
|
||||
((symbol) @keyword
|
||||
(#match? @keyword "^(defwindow|defwidget|defvar|defpoll|deflisten|geometry|children|struts)$")))
|
||||
|
||||
(list .
|
||||
((symbol) @keyword.control.import
|
||||
(#eq? @keyword.control.import "include")))
|
||||
|
||||
; Loop
|
||||
|
||||
(loop_widget . "for" @keyword.control.repeat . (symbol) @variable . "in" @keyword.operator . (symbol) @variable)
|
||||
|
||||
(loop_widget . "for" @keyword.control.repeat . (symbol) @variable . "in" @keyword.operator)
|
||||
|
||||
; Tags
|
||||
|
||||
; TODO apply to every symbol in list? I think it should probably only be applied to the first child of the list
|
||||
(list
|
||||
(symbol) @tag)
|
||||
|
||||
; Other stuff that has not been catched by the previous queries yet
|
||||
|
||||
(ident) @variable
|
||||
(index) @variable
|
||||
@ -0,0 +1,25 @@
|
||||
[
|
||||
(ast_block)
|
||||
(array)
|
||||
(expr)
|
||||
(json_array)
|
||||
(json_object)
|
||||
(parenthesized_expression)
|
||||
] @indent
|
||||
|
||||
; TODO: can't get this to work, goal is to indent at the property ":" prefix
|
||||
; ((list (identifier) (property)) @aligned_indent
|
||||
; (#set! "delimiter" ":"))
|
||||
|
||||
[")" "}" "]"] @indent_end
|
||||
|
||||
[ "{" "}" ] @branch
|
||||
|
||||
[ "(" ")" ] @branch
|
||||
|
||||
[ "[" "]" ] @branch
|
||||
|
||||
[
|
||||
(ERROR)
|
||||
(comment)
|
||||
] @auto
|
||||
@ -0,0 +1 @@
|
||||
(comment) @comment
|
||||
@ -0,0 +1,21 @@
|
||||
[
|
||||
(ast_block)
|
||||
(list)
|
||||
(array)
|
||||
(expr)
|
||||
(json_array)
|
||||
(json_object)
|
||||
(parenthesized_expression)
|
||||
] @scope
|
||||
|
||||
(symbol) @reference
|
||||
|
||||
(keyword) @definition.field
|
||||
|
||||
(json_object
|
||||
(simplexpr
|
||||
(ident) @definition.field))
|
||||
|
||||
(ast_block
|
||||
(symbol)
|
||||
(ident) @definition.type)
|
||||
@ -0,0 +1,150 @@
|
||||
; Tags
|
||||
|
||||
; TODO apply to every symbol in list? I think it should probably only be applied to the first child of the list
|
||||
(list
|
||||
(symbol) @tag)
|
||||
|
||||
; Includes
|
||||
|
||||
(list .
|
||||
((symbol) @include
|
||||
(#eq? @include "include")))
|
||||
|
||||
; Keywords
|
||||
|
||||
; I think there's a bug in tree-sitter the anchor doesn't seem to be working, see
|
||||
; https://github.com/tree-sitter/tree-sitter/pull/2107
|
||||
(list .
|
||||
((symbol) @keyword
|
||||
(#any-of? @keyword "defwindow" "defwidget" "defvar" "defpoll" "deflisten" "geometry" "children" "struts")))
|
||||
|
||||
; Loop
|
||||
|
||||
(loop_widget . "for" @repeat . (symbol) @variable . "in" @keyword.operator)
|
||||
|
||||
(loop_widget . "for" @repeat . (symbol) @variable . "in" @keyword.operator . (symbol) @variable)
|
||||
|
||||
; Builtin widgets
|
||||
|
||||
(list .
|
||||
((symbol) @tag.builtin
|
||||
(#any-of? @tag.builtin
|
||||
"box"
|
||||
"button"
|
||||
"calendar"
|
||||
"centerbox"
|
||||
"checkbox"
|
||||
"circular-progress"
|
||||
"color-button"
|
||||
"color-chooser"
|
||||
"combo-box-text"
|
||||
"eventbox"
|
||||
"expander"
|
||||
"graph"
|
||||
"image"
|
||||
"input"
|
||||
"label"
|
||||
"literal"
|
||||
"overlay"
|
||||
"progress"
|
||||
"revealer"
|
||||
"scale"
|
||||
"scroll"
|
||||
"transform")))
|
||||
|
||||
; Variables
|
||||
|
||||
(ident) @variable
|
||||
|
||||
(array
|
||||
(symbol) @variable)
|
||||
|
||||
; Properties & Fields
|
||||
|
||||
(keyword) @property
|
||||
|
||||
(json_access
|
||||
(_)
|
||||
"["
|
||||
(simplexpr
|
||||
(ident) @property))
|
||||
|
||||
(json_safe_access
|
||||
(_)
|
||||
"?."
|
||||
"["
|
||||
(simplexpr
|
||||
(ident) @property))
|
||||
|
||||
(json_dot_access
|
||||
(index) @property)
|
||||
|
||||
(json_safe_dot_access
|
||||
(index) @property)
|
||||
|
||||
(json_object
|
||||
(simplexpr
|
||||
(ident) @field))
|
||||
|
||||
; Functions
|
||||
|
||||
(function_call
|
||||
name: (ident) @function.call)
|
||||
|
||||
; Operators
|
||||
|
||||
[
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"||"
|
||||
"&&"
|
||||
"=="
|
||||
"!="
|
||||
"=~"
|
||||
">"
|
||||
"<"
|
||||
">="
|
||||
"<="
|
||||
"!"
|
||||
"?."
|
||||
"?:"
|
||||
] @operator
|
||||
|
||||
; Punctuation
|
||||
|
||||
[":" "." ","] @punctuation.delimiter
|
||||
["{" "}" "[" "]" "(" ")"] @punctuation.bracket
|
||||
|
||||
; Ternary expression
|
||||
|
||||
(ternary_expression
|
||||
["?" ":"] @conditional.ternary)
|
||||
|
||||
; Literals
|
||||
|
||||
(number) @number
|
||||
|
||||
(float) @float
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
; Strings
|
||||
|
||||
[ (string_fragment) "\"" "'" "`" ] @string
|
||||
|
||||
(string_interpolation
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special)
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
; Errors
|
||||
|
||||
(ERROR) @error
|
||||
Reference in New Issue
Block a user