1

Update generated neovim config

This commit is contained in:
2024-08-15 14:28:54 +02:00
parent 07409c223d
commit 25cfcf2941
3809 changed files with 351157 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[
(block)
(function)
(module_declaration)
(type_declaration)
(external_declaration)
(call_expression)
(switch_expression)
(parenthesized_expression)
(record)
(include_statement)+
] @fold

View File

@ -0,0 +1,335 @@
(comment) @comment @spell
; Identifiers
;------------
; Escaped identifiers like \"+."
((value_identifier) @constant.macro
(#lua-match? @constant.macro "^%.*$"))
(value_identifier) @variable
[
(type_identifier)
(unit_type)
(list)
(list_pattern)
] @type
((type_identifier) @type.builtin
(#any-of? @type.builtin "int" "char" "string" "float" "bool" "unit"))
[
(variant_identifier)
(polyvar_identifier)
] @constructor
(record_type_field
(property_identifier) @property)
(record_field
(property_identifier) @property)
(object
(field
(property_identifier) @property))
(object_type
(field
(property_identifier) @property))
(module_identifier) @module
(member_expression
(property_identifier) @variable.member)
(value_identifier_path
(module_identifier)
(value_identifier) @variable)
(record_pattern
(value_identifier_path
(value_identifier) @variable.member))
(record_pattern
(value_identifier) @variable)
(labeled_argument
label: (value_identifier) @variable.parameter)
; Parameters
;----------------
(list_pattern
(value_identifier) @variable.parameter)
(spread_pattern
(value_identifier) @variable.parameter)
; String literals
;----------------
[
(string)
(template_string)
] @string
(character) @character
(escape_sequence) @string.escape
; Other literals
;---------------
[
(true)
(false)
] @boolean
(number) @number
(polyvar) @constructor
(polyvar_string) @constructor
; Functions
;----------
; parameter(s) in parens
(parameter
(value_identifier) @variable.parameter)
(labeled_parameter
(value_identifier) @variable.parameter)
; single parameter with no parens
(function
parameter: (value_identifier) @variable.parameter)
(parameter
(tuple_pattern
(tuple_item_pattern
(value_identifier) @variable.parameter)))
(parameter
(array_pattern
(value_identifier) @variable.parameter))
(parameter
(record_pattern
(value_identifier) @variable.parameter))
; function identifier in let binding
(let_binding
pattern: (value_identifier) @function
body: (function))
; function calls
(call_expression
function: (value_identifier_path
(value_identifier) @function.method.call .))
(call_expression
function: (value_identifier) @function.call)
; highlight the right-hand side of a pipe operator as a function call
(pipe_expression
(value_identifier) @function.call .)
(pipe_expression
(value_identifier_path
(value_identifier) @function.method.call .) .)
; Meta
;-----
(decorator_identifier) @attribute
(extension_identifier) @keyword
"%" @keyword
; Misc
;-----
(polyvar_type_pattern
"#" @constructor)
[
"include"
"open"
] @keyword.import
[
"private"
"mutable"
"rec"
] @keyword.modifier
"type" @keyword.type
[
"and"
"with"
"as"
] @keyword.operator
[
"export"
"external"
"let"
"module"
"assert"
"await"
"lazy"
"constraint"
] @keyword
"await" @keyword.coroutine
(function
"async" @keyword.coroutine)
(module_unpack
"unpack" @keyword)
[
"if"
"else"
"switch"
"when"
] @keyword.conditional
[
"exception"
"try"
"catch"
] @keyword.exception
(call_expression
function: (value_identifier) @keyword.exception
(#eq? @keyword.exception "raise"))
[
"for"
"in"
"to"
"downto"
"while"
] @keyword.repeat
[
"."
","
"|"
":"
] @punctuation.delimiter
[
"++"
"+"
"+."
"-"
"-."
"*"
"**"
"*."
"/."
"<="
"=="
"==="
"!"
"!="
"!=="
">="
"&&"
"||"
"="
":="
"->"
"|>"
":>"
"+="
"=>"
(uncurry)
] @operator
; Explicitly enclose these operators with binary_expression
; to avoid confusion with JSX tag delimiters
(binary_expression
[
"<"
">"
"/"
] @operator)
[
"("
")"
"{"
"}"
"["
"]"
"<"
">"
] @punctuation.bracket
(unit
[
"("
")"
] @constant.builtin)
(template_substitution
"${" @punctuation.special
"}" @punctuation.special) @none
(polyvar_type
[
"["
"[>"
"[<"
"]"
] @punctuation.bracket)
[
"~"
"?"
".."
"..."
] @punctuation.special
(ternary_expression
[
"?"
":"
] @keyword.conditional.ternary)
; JSX
;----------
(jsx_identifier) @tag
(jsx_element
open_tag: (jsx_opening_element
[
"<"
">"
] @tag.delimiter))
(jsx_element
close_tag: (jsx_closing_element
[
"<"
"/"
">"
] @tag.delimiter))
(jsx_self_closing_element
[
"/"
">"
"<"
] @tag.delimiter)
(jsx_fragment
[
">"
"<"
"/"
] @tag.delimiter)
(jsx_attribute
(property_identifier) @tag.attribute)

View File

@ -0,0 +1,36 @@
[
(block)
(record_type)
(record)
(parenthesized_expression)
(call_expression)
(function_type_parameters)
(function)
(switch_match)
(let_declaration)
(jsx_element)
(jsx_fragment)
(jsx_self_closing_element)
(object_type)
] @indent.begin
[
"}"
")"
(jsx_closing_element)
] @indent.branch @indent.end
(jsx_self_closing_element
"/" @indent.branch
">"? @indent.end)
; </> is captured as 3 different anonymous nodes
(jsx_fragment
"<"
"<" @indent.branch)
(jsx_fragment
">"
">" @indent.end)
(comment) @indent.auto

View File

@ -0,0 +1,33 @@
((comment) @injection.content
(#set! injection.language "comment"))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "re")
(expression_statement
(_) @injection.content
(#set! injection.language "regex")))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "raw")
(expression_statement
(_
(_) @injection.content
(#set! injection.language "javascript"))))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "graphql")
(expression_statement
(_
(_) @injection.content
(#set! injection.language "graphql"))))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "relay")
(expression_statement
(_
(_) @injection.content
(#set! injection.language "graphql"))))

View File

@ -0,0 +1,9 @@
(switch_expression) @local.scope
; Definitions
;------------
(type_declaration) @local.definition.type
(let_binding) @local.definition.var
(module_declaration) @local.definition.namespace