mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
Fixup format (#5934)
* fix(format): newline between top-level field defs * fixup: newline between node and comment * fixup: optimize pattern
This commit is contained in:
parent
f5a839d1e8
commit
d198a75e2c
35 changed files with 47 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
(initializer_list)
|
(initializer_list)
|
||||||
(init_declarator)
|
(init_declarator)
|
||||||
] @indent.begin
|
] @indent.begin
|
||||||
|
|
||||||
; With current indent logic, if we capture expression_statement with @indent.begin
|
; With current indent logic, if we capture expression_statement with @indent.begin
|
||||||
; It will be affected by _parent_ node with error subnodes deep down the tree
|
; It will be affected by _parent_ node with error subnodes deep down the tree
|
||||||
; So narrow indent capture to check for error inside expression statement only,
|
; So narrow indent capture to check for error inside expression statement only,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ body:
|
||||||
(switch_body)
|
(switch_body)
|
||||||
(enum_member_declaration_list)
|
(enum_member_declaration_list)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
accessors: (accessor_list) @fold
|
accessors: (accessor_list) @fold
|
||||||
|
|
||||||
initializer: (initializer_expression) @fold
|
initializer: (initializer_expression) @fold
|
||||||
|
|
||||||
(block) @fold
|
(block) @fold
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,7 @@
|
||||||
"seq-to-map-for-destructuring" "update-keys" "update-vals"
|
"seq-to-map-for-destructuring" "update-keys" "update-vals"
|
||||||
;; 1.12
|
;; 1.12
|
||||||
"partitionv" "partitionv-all" "splitv-at"))
|
"partitionv" "partitionv-all" "splitv-at"))
|
||||||
|
|
||||||
; >> Context based highlighting
|
; >> Context based highlighting
|
||||||
; def-likes
|
; def-likes
|
||||||
; Correctly highlight docstrings
|
; Correctly highlight docstrings
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
(sym_lit) @variable
|
(sym_lit) @variable
|
||||||
|
|
||||||
; A highlighting for functions/macros in th cl namespace is available in theHamsta/nvim-treesitter-commonlisp
|
; A highlighting for functions/macros in th cl namespace is available in theHamsta/nvim-treesitter-commonlisp
|
||||||
;(list_lit . (sym_lit) @function.builtin (#cl-standard-function? @function.builtin))
|
;(list_lit . (sym_lit) @function.builtin (#cl-standard-function? @function.builtin))
|
||||||
;(list_lit . (sym_lit) @function.builtin (#cl-standard-macro? @function.macro))
|
;(list_lit . (sym_lit) @function.builtin (#cl-standard-macro? @function.macro))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
(dotted_identifier_list) @string
|
(dotted_identifier_list) @string
|
||||||
|
|
||||||
; Methods
|
; Methods
|
||||||
; --------------------
|
; --------------------
|
||||||
(super) @function
|
(super) @function
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@
|
||||||
"<%%="
|
"<%%="
|
||||||
"<%="
|
"<%="
|
||||||
] @tag.delimiter
|
] @tag.delimiter
|
||||||
|
|
||||||
; EEx comments are highlighted as such
|
; EEx comments are highlighted as such
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))))
|
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))))
|
||||||
]
|
]
|
||||||
operator: "=")
|
operator: "=")
|
||||||
|
|
||||||
; Stab Clause Definitions
|
; Stab Clause Definitions
|
||||||
; format-ignore
|
; format-ignore
|
||||||
(stab_clause
|
(stab_clause
|
||||||
|
|
@ -98,6 +99,7 @@
|
||||||
])
|
])
|
||||||
operator: "when")
|
operator: "when")
|
||||||
])
|
])
|
||||||
|
|
||||||
; Aliases
|
; Aliases
|
||||||
; format-ignore
|
; format-ignore
|
||||||
(call
|
(call
|
||||||
|
|
@ -155,6 +157,7 @@
|
||||||
]))
|
]))
|
||||||
]?)
|
]?)
|
||||||
(#set! definition.function.scope parent)(do_block)?) @local.scope
|
(#set! definition.function.scope parent)(do_block)?) @local.scope
|
||||||
|
|
||||||
; ExUnit Test Definitions & Scopes
|
; ExUnit Test Definitions & Scopes
|
||||||
; format-ignore
|
; format-ignore
|
||||||
(call
|
(call
|
||||||
|
|
@ -193,5 +196,6 @@
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
(do_block)?) @local.scope
|
(do_block)?) @local.scope
|
||||||
|
|
||||||
; Stab Clause Scopes
|
; Stab Clause Scopes
|
||||||
(stab_clause) @local.scope
|
(stab_clause) @local.scope
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
(lambda)
|
(lambda)
|
||||||
(constructor_definition)
|
(constructor_definition)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
; It's nice to be able to fold the if/elif/else clauses and the entire
|
; It's nice to be able to fold the if/elif/else clauses and the entire
|
||||||
; if_statement.
|
; if_statement.
|
||||||
(if_statement
|
(if_statement
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,7 @@
|
||||||
"Color8" "assert" "char" "convert" "dict_to_inst" "get_stack" "inst_to_dict"
|
"Color8" "assert" "char" "convert" "dict_to_inst" "get_stack" "inst_to_dict"
|
||||||
"is_instance_of" "len" "print_debug" "print_stack" "range"
|
"is_instance_of" "len" "print_debug" "print_stack" "range"
|
||||||
"type_exists"))
|
"type_exists"))
|
||||||
|
|
||||||
; Builtin Constants
|
; Builtin Constants
|
||||||
((identifier) @constant.builtin
|
((identifier) @constant.builtin
|
||||||
; format-ignore
|
; format-ignore
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
(tag_name) @tag
|
(tag_name) @tag
|
||||||
|
|
||||||
; (erroneous_end_tag_name) @error ; we do not lint syntax errors
|
; (erroneous_end_tag_name) @error ; we do not lint syntax errors
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
(element
|
(element
|
||||||
(self_closing_tag))
|
(self_closing_tag))
|
||||||
] @indent.begin
|
] @indent.begin
|
||||||
|
|
||||||
; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them
|
; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them
|
||||||
; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined
|
; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined
|
||||||
((start_tag
|
((start_tag
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; <style>...</style>
|
; <style>...</style>
|
||||||
; <style blocking> ...</style>
|
; <style blocking> ...</style>
|
||||||
; Add "lang" to predicate check so that vue/svelte can inherit this
|
; Add "lang" to predicate check so that vue/svelte can inherit this
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,7 @@
|
||||||
"y0"
|
"y0"
|
||||||
"y1"
|
"y1"
|
||||||
"yn"))
|
"yn"))
|
||||||
|
|
||||||
; Keywords
|
; Keywords
|
||||||
[
|
[
|
||||||
"def"
|
"def"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; test(val)
|
; test(val)
|
||||||
(query
|
(query
|
||||||
((funcname) @_function
|
((funcname) @_function
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
(multiline_comment)
|
(multiline_comment)
|
||||||
] @injection.content
|
] @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; There are 3 ways to define a regex
|
; There are 3 ways to define a regex
|
||||||
; - "[abc]?".toRegex()
|
; - "[abc]?".toRegex()
|
||||||
(call_expression
|
(call_expression
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
(items_block)
|
(items_block)
|
||||||
(block)
|
(block)
|
||||||
] @indent.begin
|
] @indent.begin
|
||||||
|
|
||||||
; if "if" statement and conditional statement are in separate lines
|
; if "if" statement and conditional statement are in separate lines
|
||||||
; conditional should be indented and when the conditional block
|
; conditional should be indented and when the conditional block
|
||||||
; starts dedented
|
; starts dedented
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
"default"
|
"default"
|
||||||
(arith_cmp_predicate)
|
(arith_cmp_predicate)
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
; format-ignore
|
; format-ignore
|
||||||
[
|
[
|
||||||
"module"
|
"module"
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@
|
||||||
; primops, `__<tab>` in `nix repl`
|
; primops, `__<tab>` in `nix repl`
|
||||||
"__add" "__filter" "__isFunction" "__split" "__addErrorContext" "__filterSource" "__isInt" "__splitVersion" "__all" "__findFile" "__isList" "__storeDir" "__any" "__floor" "__isPath" "__storePath" "__appendContext" "__foldl'" "__isString" "__stringLength" "__attrNames" "__fromJSON" "__langVersion" "__sub" "__attrValues" "__functionArgs" "__length" "__substring" "__bitAnd" "__genList" "__lessThan" "__tail" "__bitOr" "__genericClosure" "__listToAttrs" "__toFile" "__bitXor" "__getAttr" "__mapAttrs" "__toJSON" "__catAttrs" "__getContext" "__match" "__toPath" "__ceil" "__getEnv" "__mul" "__toXML" "__compareVersions" "__getFlake" "__nixPath" "__trace" "__concatLists" "__groupBy" "__nixVersion" "__traceVerbose" "__concatMap" "__hasAttr" "__parseDrvName" "__tryEval" "__concatStringsSep" "__hasContext" "__partition" "__typeOf" "__currentSystem" "__hashFile" "__path" "__unsafeDiscardOutputDependency" "__currentTime" "__hashString" "__pathExists" "__unsafeDiscardStringContext" "__deepSeq" "__head" "__readDir" "__unsafeGetAttrPos" "__div" "__intersectAttrs" "__readFile" "__zipAttrsWith" "__elem" "__isAttrs" "__replaceStrings" "__elemAt" "__isBool" "__seq" "__fetchurl" "__isFloat" "__sort")
|
"__add" "__filter" "__isFunction" "__split" "__addErrorContext" "__filterSource" "__isInt" "__splitVersion" "__all" "__findFile" "__isList" "__storeDir" "__any" "__floor" "__isPath" "__storePath" "__appendContext" "__foldl'" "__isString" "__stringLength" "__attrNames" "__fromJSON" "__langVersion" "__sub" "__attrValues" "__functionArgs" "__length" "__substring" "__bitAnd" "__genList" "__lessThan" "__tail" "__bitOr" "__genericClosure" "__listToAttrs" "__toFile" "__bitXor" "__getAttr" "__mapAttrs" "__toJSON" "__catAttrs" "__getContext" "__match" "__toPath" "__ceil" "__getEnv" "__mul" "__toXML" "__compareVersions" "__getFlake" "__nixPath" "__trace" "__concatLists" "__groupBy" "__nixVersion" "__traceVerbose" "__concatMap" "__hasAttr" "__parseDrvName" "__tryEval" "__concatStringsSep" "__hasContext" "__partition" "__typeOf" "__currentSystem" "__hashFile" "__path" "__unsafeDiscardOutputDependency" "__currentTime" "__hashString" "__pathExists" "__unsafeDiscardStringContext" "__deepSeq" "__head" "__readDir" "__unsafeGetAttrPos" "__div" "__intersectAttrs" "__readFile" "__zipAttrsWith" "__elem" "__isAttrs" "__replaceStrings" "__elemAt" "__isBool" "__seq" "__fetchurl" "__isFloat" "__sort")
|
||||||
)
|
)
|
||||||
|
|
||||||
; constants
|
; constants
|
||||||
(variable_expression
|
(variable_expression
|
||||||
name: (identifier) @constant.builtin
|
name: (identifier) @constant.builtin
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; There is no parser for assembly language yet. Add an injection here when we
|
; There is no parser for assembly language yet. Add an injection here when we
|
||||||
; have a parser.
|
; have a parser.
|
||||||
; ((asmBody) @injection.content
|
; ((asmBody) @injection.content
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
(assignment
|
(assignment
|
||||||
alias: (field) @variable.member)
|
alias: (field) @variable.member)
|
||||||
|
|
||||||
alias: (identifier) @variable.member
|
alias: (identifier) @variable.member
|
||||||
|
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,6 @@
|
||||||
((doctest_block) @injection.content
|
((doctest_block) @injection.content
|
||||||
(#set! injection.language "python"))
|
(#set! injection.language "python"))
|
||||||
|
|
||||||
; Directives with nested content without arguments nor options
|
; Directives with nested content without arguments nor options
|
||||||
((directive
|
((directive
|
||||||
name: (type) @_type
|
name: (type) @_type
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
(host_declaration)
|
(host_declaration)
|
||||||
(match_declaration)
|
(match_declaration)
|
||||||
] @indent.begin
|
] @indent.begin
|
||||||
|
|
||||||
; incomplete declarations
|
; incomplete declarations
|
||||||
(ERROR
|
(ERROR
|
||||||
.
|
.
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
":"
|
":"
|
||||||
","
|
","
|
||||||
] @punctuation.delimiter
|
] @punctuation.delimiter
|
||||||
|
|
||||||
; TODO: "\\(" ")" in interpolations should be @punctuation.special
|
; TODO: "\\(" ")" in interpolations should be @punctuation.special
|
||||||
[
|
[
|
||||||
"\\("
|
"\\("
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
(block) @local.scope
|
(block) @local.scope
|
||||||
|
|
||||||
; Parameter definitions
|
; Parameter definitions
|
||||||
(parameter_declaration
|
(parameter_declaration
|
||||||
command: (identifier)
|
command: (identifier)
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,5 @@
|
||||||
(class_type)
|
(class_type)
|
||||||
(method_declaration)
|
(method_declaration)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
; vim: sw=2 foldmethod=marker
|
; vim: sw=2 foldmethod=marker
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; vim: sw=2 foldmethod=marker
|
; vim: sw=2 foldmethod=marker
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@
|
||||||
|
|
||||||
((identifier) @function.builtin
|
((identifier) @function.builtin
|
||||||
(#any-of? @function.builtin "eprint" "eprintln" "error" "exit" "panic" "print" "println" "after" "after_char" "all" "all_after" "all_after_last" "all_before" "all_before_last" "any" "ascii_str" "before" "bool" "byte" "byterune" "bytes" "bytestr" "c_error_number_str" "capitalize" "clear" "clone" "clone_to_depth" "close" "code" "compare" "compare_strings" "contains" "contains_any" "contains_any_substr" "copy" "count" "cstring_to_vstring" "delete" "delete_last" "delete_many" "ends_with" "eprint" "eprintln" "eq_epsilon" "error" "error_with_code" "exit" "f32" "f32_abs" "f32_max" "f32_min" "f64" "f64_max" "fields" "filter" "find_between" "first" "flush_stderr" "flush_stdout" "free" "gc_check_leaks" "get_str_intp_u32_format" "get_str_intp_u64_format" "grow_cap" "grow_len" "hash" "hex" "hex2" "hex_full" "i16" "i64" "i8" "index" "index_after" "index_any" "index_byte" "insert" "int" "is_alnum" "is_bin_digit" "is_capital" "is_digit" "is_hex_digit" "is_letter" "is_lower" "is_oct_digit" "is_space" "is_title" "is_upper" "isnil" "join" "join_lines" "keys" "last" "last_index" "last_index_byte" "length_in_bytes" "limit" "malloc" "malloc_noscan" "map" "match_glob" "memdup" "memdup_noscan" "move" "msg" "panic" "panic_error_number" "panic_lasterr" "panic_optional_not_set" "parse_int" "parse_uint" "pointers" "pop" "prepend" "print" "print_backtrace" "println" "proc_pidpath" "ptr_str" "push_many" "realloc_data" "reduce" "repeat" "repeat_to_depth" "replace" "replace_each" "replace_once" "reverse" "reverse_in_place" "runes" "sort" "sort_by_len" "sort_ignore_case" "sort_with_compare" "split" "split_any" "split_into_lines" "split_nth" "starts_with" "starts_with_capital" "str" "str_escaped" "str_intp" "str_intp_g32" "str_intp_g64" "str_intp_rune" "str_intp_sq" "str_intp_sub" "strg" "string_from_wide" "string_from_wide2" "strip_margin" "strip_margin_custom" "strlong" "strsci" "substr" "substr_ni" "substr_with_check" "title" "to_lower" "to_upper" "to_wide" "tos" "tos2" "tos3" "tos4" "tos5" "tos_clone" "trim" "trim_left" "trim_pr" "try_pop" "try_push" "utf32_decode_to_buffer" "utf32_to_str" "utf32_to_str_no_malloc" "utf8_char_len" "utf8_getchar" "utf8_str_len" "utf8_str_visible_length" "utf8_to_utf32" "v_realloc" "vbytes" "vcalloc" "vcalloc_noscan" "vmemcmp" "vmemcpy" "vmemmove" "vmemset" "vstring" "vstring_literal" "vstring_literal_with_len" "vstring_with_len" "vstrlen" "vstrlen_char" "winapi_lasterr_str"))
|
(#any-of? @function.builtin "eprint" "eprintln" "error" "exit" "panic" "print" "println" "after" "after_char" "all" "all_after" "all_after_last" "all_before" "all_before_last" "any" "ascii_str" "before" "bool" "byte" "byterune" "bytes" "bytestr" "c_error_number_str" "capitalize" "clear" "clone" "clone_to_depth" "close" "code" "compare" "compare_strings" "contains" "contains_any" "contains_any_substr" "copy" "count" "cstring_to_vstring" "delete" "delete_last" "delete_many" "ends_with" "eprint" "eprintln" "eq_epsilon" "error" "error_with_code" "exit" "f32" "f32_abs" "f32_max" "f32_min" "f64" "f64_max" "fields" "filter" "find_between" "first" "flush_stderr" "flush_stdout" "free" "gc_check_leaks" "get_str_intp_u32_format" "get_str_intp_u64_format" "grow_cap" "grow_len" "hash" "hex" "hex2" "hex_full" "i16" "i64" "i8" "index" "index_after" "index_any" "index_byte" "insert" "int" "is_alnum" "is_bin_digit" "is_capital" "is_digit" "is_hex_digit" "is_letter" "is_lower" "is_oct_digit" "is_space" "is_title" "is_upper" "isnil" "join" "join_lines" "keys" "last" "last_index" "last_index_byte" "length_in_bytes" "limit" "malloc" "malloc_noscan" "map" "match_glob" "memdup" "memdup_noscan" "move" "msg" "panic" "panic_error_number" "panic_lasterr" "panic_optional_not_set" "parse_int" "parse_uint" "pointers" "pop" "prepend" "print" "print_backtrace" "println" "proc_pidpath" "ptr_str" "push_many" "realloc_data" "reduce" "repeat" "repeat_to_depth" "replace" "replace_each" "replace_once" "reverse" "reverse_in_place" "runes" "sort" "sort_by_len" "sort_ignore_case" "sort_with_compare" "split" "split_any" "split_into_lines" "split_nth" "starts_with" "starts_with_capital" "str" "str_escaped" "str_intp" "str_intp_g32" "str_intp_g64" "str_intp_rune" "str_intp_sq" "str_intp_sub" "strg" "string_from_wide" "string_from_wide2" "strip_margin" "strip_margin_custom" "strlong" "strsci" "substr" "substr_ni" "substr_with_check" "title" "to_lower" "to_upper" "to_wide" "tos" "tos2" "tos3" "tos4" "tos5" "tos_clone" "trim" "trim_left" "trim_pr" "try_pop" "try_push" "utf32_decode_to_buffer" "utf32_to_str" "utf32_to_str_no_malloc" "utf8_char_len" "utf8_getchar" "utf8_str_len" "utf8_str_visible_length" "utf8_to_utf32" "v_realloc" "vbytes" "vcalloc" "vcalloc_noscan" "vmemcmp" "vmemcpy" "vmemmove" "vmemset" "vstring" "vstring_literal" "vstring_literal_with_len" "vstring_with_len" "vstrlen" "vstrlen_char" "winapi_lasterr_str"))
|
||||||
|
|
||||||
; Operators
|
; Operators
|
||||||
[
|
[
|
||||||
"++"
|
"++"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; asm_statement if asm ever highlighted :)
|
; asm_statement if asm ever highlighted :)
|
||||||
; #include <...>
|
; #include <...>
|
||||||
((hash_statement) @injection.content
|
((hash_statement) @injection.content
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
((Comment) @injection.content
|
((Comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; SVG style
|
; SVG style
|
||||||
((element
|
((element
|
||||||
(STag
|
(STag
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
((comment) @injection.content
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
; Github actions ("run") / Gitlab CI ("scripts")
|
; Github actions ("run") / Gitlab CI ("scripts")
|
||||||
(block_mapping_pair
|
(block_mapping_pair
|
||||||
key: (flow_node) @_run
|
key: (flow_node) @_run
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
; Module / submodule
|
; Module / submodule
|
||||||
[
|
[
|
||||||
"module"
|
"module"
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
(json_object)
|
(json_object)
|
||||||
(parenthesized_expression)
|
(parenthesized_expression)
|
||||||
] @indent.begin
|
] @indent.begin
|
||||||
|
|
||||||
; TODO: can't get this to work, goal is to indent at the property ":" prefix
|
; TODO: can't get this to work, goal is to indent at the property ":" prefix
|
||||||
; ((list (identifier) (property)) @indent.align
|
; ((list (identifier) (property)) @indent.align
|
||||||
; (#set! indent.open_delimiter "(")
|
; (#set! indent.open_delimiter "(")
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
variable: (IDENTIFIER)
|
variable: (IDENTIFIER)
|
||||||
variable_type_function: (IDENTIFIER)
|
variable_type_function: (IDENTIFIER)
|
||||||
] @variable
|
] @variable
|
||||||
|
|
||||||
parameter: (IDENTIFIER) @variable.parameter
|
parameter: (IDENTIFIER) @variable.parameter
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -38,8 +39,11 @@ parameter: (IDENTIFIER) @variable.parameter
|
||||||
field_access: (IDENTIFIER)
|
field_access: (IDENTIFIER)
|
||||||
] @constant
|
] @constant
|
||||||
(#lua-match? @constant "^%u[%u%d_]+$"))
|
(#lua-match? @constant "^%u[%u%d_]+$"))
|
||||||
|
|
||||||
function: (IDENTIFIER) @function
|
function: (IDENTIFIER) @function
|
||||||
|
|
||||||
function_call: (IDENTIFIER) @function.call
|
function_call: (IDENTIFIER) @function.call
|
||||||
|
|
||||||
exception: "!" @keyword.exception
|
exception: "!" @keyword.exception
|
||||||
|
|
||||||
((IDENTIFIER) @variable.builtin
|
((IDENTIFIER) @variable.builtin
|
||||||
|
|
@ -55,6 +59,7 @@ exception: "!" @keyword.exception
|
||||||
])
|
])
|
||||||
(ContainerField
|
(ContainerField
|
||||||
(IDENTIFIER) @constant))
|
(IDENTIFIER) @constant))
|
||||||
|
|
||||||
field_constant: (IDENTIFIER) @constant
|
field_constant: (IDENTIFIER) @constant
|
||||||
|
|
||||||
(BUILTINIDENTIFIER) @function.builtin
|
(BUILTINIDENTIFIER) @function.builtin
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,7 @@ local format_queries = [[
|
||||||
;; Preserve inline comments
|
;; Preserve inline comments
|
||||||
(program
|
(program
|
||||||
. (_)
|
. (_)
|
||||||
(_) @_comment
|
|
||||||
.
|
|
||||||
(comment) @format.prepend-newline
|
(comment) @format.prepend-newline
|
||||||
(#not-has-type? @_comment comment)
|
|
||||||
(#is-start-of-line? @format.prepend-newline))
|
(#is-start-of-line? @format.prepend-newline))
|
||||||
(program
|
(program
|
||||||
. (_)
|
. (_)
|
||||||
|
|
@ -77,7 +74,9 @@ local format_queries = [[
|
||||||
(grouping)
|
(grouping)
|
||||||
(named_node)
|
(named_node)
|
||||||
(anonymous_node)
|
(anonymous_node)
|
||||||
|
(field_definition)
|
||||||
] @format.prepend-newline)
|
] @format.prepend-newline)
|
||||||
|
|
||||||
(program
|
(program
|
||||||
(comment) @_comment
|
(comment) @_comment
|
||||||
.
|
.
|
||||||
|
|
@ -86,6 +85,8 @@ local format_queries = [[
|
||||||
(grouping)
|
(grouping)
|
||||||
(named_node)
|
(named_node)
|
||||||
(anonymous_node)
|
(anonymous_node)
|
||||||
|
(field_definition)
|
||||||
|
(comment)
|
||||||
] @format.cancel-prepend
|
] @format.cancel-prepend
|
||||||
(#is-start-of-line? @_comment))
|
(#is-start-of-line? @_comment))
|
||||||
;; }}}
|
;; }}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue