aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/angular/highlights.scm6
-rw-r--r--runtime/queries/bash/indents.scm32
-rw-r--r--runtime/queries/bpftrace/highlights.scm229
-rw-r--r--runtime/queries/bpftrace/injections.scm12
-rw-r--r--runtime/queries/c3/highlights.scm31
-rw-r--r--runtime/queries/c3/indents.scm6
-rw-r--r--runtime/queries/c_sharp/highlights.scm3
-rw-r--r--runtime/queries/diff/highlights.scm9
-rw-r--r--runtime/queries/ecma/injections.scm7
-rw-r--r--runtime/queries/ecma/locals.scm5
-rw-r--r--runtime/queries/editorconfig/highlights.scm50
-rw-r--r--runtime/queries/enforce/highlights.scm12
-rw-r--r--runtime/queries/fish/highlights.scm29
-rw-r--r--runtime/queries/fortran/highlights.scm22
-rw-r--r--runtime/queries/glimmer/injections.scm19
-rw-r--r--runtime/queries/glimmer_typescript/indents.scm2
-rw-r--r--runtime/queries/gnuplot/folds.scm1
-rw-r--r--runtime/queries/gnuplot/highlights.scm889
-rw-r--r--runtime/queries/go/highlights.scm34
-rw-r--r--runtime/queries/haskell/highlights.scm8
-rw-r--r--runtime/queries/hlsplaylist/highlights.scm41
-rw-r--r--runtime/queries/hlsplaylist/injections.scm2
-rw-r--r--runtime/queries/html_tags/highlights.scm6
-rw-r--r--runtime/queries/jinja_inline/highlights.scm25
-rw-r--r--runtime/queries/jjdescription/highlights.scm42
-rw-r--r--runtime/queries/jjdescription/injections.scm6
-rw-r--r--runtime/queries/kos/folds.scm19
-rw-r--r--runtime/queries/kos/highlights.scm156
-rw-r--r--runtime/queries/kos/injections.scm6
-rw-r--r--runtime/queries/kos/locals.scm41
-rw-r--r--runtime/queries/kotlin/highlights.scm13
-rw-r--r--runtime/queries/kotlin/injections.scm12
-rw-r--r--runtime/queries/lua/injections.scm4
-rw-r--r--runtime/queries/make/highlights.scm1
-rw-r--r--runtime/queries/markdown_inline/highlights.scm13
-rw-r--r--runtime/queries/muttrc/highlights.scm55
-rw-r--r--runtime/queries/muttrc/injections.scm8
-rw-r--r--runtime/queries/nickel/highlights.scm97
-rw-r--r--runtime/queries/nix/injections.scm12
-rw-r--r--runtime/queries/problog/folds.scm1
-rw-r--r--runtime/queries/problog/highlights.scm4
-rw-r--r--runtime/queries/problog/indents.scm1
-rw-r--r--runtime/queries/problog/injections.scm1
-rw-r--r--runtime/queries/prolog/folds.scm6
-rw-r--r--runtime/queries/prolog/highlights.scm43
-rw-r--r--runtime/queries/prolog/indents.scm16
-rw-r--r--runtime/queries/prolog/injections.scm2
-rw-r--r--runtime/queries/proto/folds.scm2
-rw-r--r--runtime/queries/proto/highlights.scm20
-rw-r--r--runtime/queries/python/injections.scm19
-rw-r--r--runtime/queries/r/highlights.scm3
-rw-r--r--runtime/queries/razor/highlights.scm5
-rw-r--r--runtime/queries/rescript/highlights.scm5
-rw-r--r--runtime/queries/rescript/indents.scm5
-rw-r--r--runtime/queries/rescript/injections.scm5
-rw-r--r--runtime/queries/robot/highlights.scm8
-rw-r--r--runtime/queries/ruby/highlights.scm13
-rw-r--r--runtime/queries/rust/highlights.scm5
-rw-r--r--runtime/queries/rust/injections.scm4
-rw-r--r--runtime/queries/scala/highlights.scm3
-rw-r--r--runtime/queries/scala/indents.scm32
-rw-r--r--runtime/queries/supercollider/folds.scm1
-rw-r--r--runtime/queries/supercollider/highlights.scm73
-rw-r--r--runtime/queries/supercollider/indents.scm19
-rw-r--r--runtime/queries/supercollider/locals.scm1
-rw-r--r--runtime/queries/swift/highlights.scm2
-rw-r--r--runtime/queries/textproto/highlights.scm12
-rw-r--r--runtime/queries/tmux/highlights.scm65
-rw-r--r--runtime/queries/tmux/injections.scm5
-rw-r--r--runtime/queries/typst/highlights.scm12
-rw-r--r--runtime/queries/typst/indents.scm4
-rw-r--r--runtime/queries/usd/highlights.scm2
-rw-r--r--runtime/queries/vento/highlights.scm22
-rw-r--r--runtime/queries/wit/highlights.scm10
-rw-r--r--runtime/queries/yuck/indents.scm2
-rw-r--r--runtime/queries/yuck/locals.scm7
-rw-r--r--runtime/queries/zathurarc/highlights.scm36
-rw-r--r--runtime/queries/zathurarc/injections.scm9
-rw-r--r--runtime/queries/zsh/highlights.scm4
79 files changed, 1379 insertions, 1075 deletions
diff --git a/runtime/queries/angular/highlights.scm b/runtime/queries/angular/highlights.scm
index ad192329a..d248d2e4c 100644
--- a/runtime/queries/angular/highlights.scm
+++ b/runtime/queries/angular/highlights.scm
@@ -28,6 +28,12 @@
(binding_name
(identifier) @keyword)
+(class_binding
+ [
+ (identifier)
+ (class_name)
+ ] @keyword)
+
(event_binding
(binding_name
(identifier) @keyword))
diff --git a/runtime/queries/bash/indents.scm b/runtime/queries/bash/indents.scm
new file mode 100644
index 000000000..c0a4bed47
--- /dev/null
+++ b/runtime/queries/bash/indents.scm
@@ -0,0 +1,32 @@
+[
+ (if_statement)
+ (for_statement)
+ (while_statement)
+ (case_statement)
+ (function_definition)
+ (compound_statement)
+ (subshell)
+ (command_substitution)
+ (do_group)
+ (case_item)
+] @indent.begin
+
+[
+ "fi"
+ "done"
+ "esac"
+ "}"
+ ")"
+ "then"
+ "do"
+ (elif_clause)
+ (else_clause)
+] @indent.branch
+
+[
+ "fi"
+ "done"
+ "esac"
+ "}"
+ ")"
+] @indent.end
diff --git a/runtime/queries/bpftrace/highlights.scm b/runtime/queries/bpftrace/highlights.scm
new file mode 100644
index 000000000..49eae9ffd
--- /dev/null
+++ b/runtime/queries/bpftrace/highlights.scm
@@ -0,0 +1,229 @@
+; Comments
+[
+ (line_comment)
+ (block_comment)
+] @comment @spell
+
+; String and numeric literals
+(string_literal) @string
+
+(escape_sequence) @string.escape
+
+(integer_literal) @number
+
+(boolean_literal) @boolean
+
+; Variables
+(identifier) @variable
+
+(args_keyword) @variable.builtin
+
+(argn_identifier) @variable.builtin
+
+(retval_identifier) @variable.builtin
+
+(scratch_variable) @variable
+
+(map_variable) @variable
+
+(script_parameter) @variable.parameter
+
+; Macro
+(macro_definition
+ (identifier) @function.macro)
+
+; Probes
+; fentry/fexit, kprobe/kretprobe, rawtracepoint
+(probe
+ provider: (_) @type.builtin
+ module: (wildcard_identifier) @module
+ function: (wildcard_identifier) @property)
+
+(probe
+ provider: (_) @type.builtin
+ function: (wildcard_identifier) @property)
+
+; uprobe/uretprobe
+(probe
+ provider: (uprobe_uretprobe_provider) @type.builtin
+ binary: (file_identifier) @string.special.path
+ function: (wildcard_identifier) @property)
+
+; tracepoint
+(probe
+ provider: (_) @type.builtin
+ subsys: (wildcard_identifier) @module
+ event: (wildcard_identifier) @property)
+
+; software/hardware
+(probe
+ provider: (_) @type.builtin
+ event: (identifier_with_dash) @property
+ count: (integer_literal) @number)
+
+(probe
+ provider: (_) @type.builtin
+ event: (identifier_with_dash) @property)
+
+; bench/test
+(probe
+ provider: (bench_test_provider) @type.builtin
+ function: (identifier) @property)
+
+; profile/interval
+(probe
+ provider: (profile_interval_provider) @type.builtin
+ unit: (time_unit) @string.special
+ count: (integer_literal) @property)
+
+(probe
+ provider: (profile_interval_provider) @type.builtin
+ count: (integer_literal) @number)
+
+; iter
+(probe
+ provider: (iter_provider) @type.builtin
+ object: (identifier) @module
+ pin: (file_identifier) @property)
+
+(probe
+ provider: (iter_provider) @type.builtin
+ object: (identifier) @module)
+
+; ustd
+(probe
+ provider: (ustd_provider) @type.builtin
+ binary: (file_identifier) @string.special.path
+ namespace: (wildcard_identifier) @variable
+ function: (wildcard_identifier) @property)
+
+(probe
+ provider: (ustd_provider) @type.builtin
+ binary: (file_identifier) @string.special.path
+ function: (wildcard_identifier) @property)
+
+; watchpoint/asyncwatchpoint
+(probe
+ provider: (watchpoint_provider) @type.builtin
+ address: (integer_literal) @number
+ length: (integer_literal) @number
+ mode: (watchpoint_mode) @property)
+
+; Types
+(type_specifier) @type
+
+(integer_type) @type.builtin
+
+[
+ "BEGIN"
+ "begin"
+ "END"
+ "end"
+] @type.builtin
+
+; Keywords
+(hashbang) @keyword.directive
+
+(return_statement) @keyword.return
+
+[
+ "config"
+ "let"
+ "macro"
+ "offsetof"
+ "sizeof"
+] @keyword
+
+[
+ "if"
+ "else"
+] @keyword.conditional
+
+[
+ "for"
+ "unroll"
+ "while"
+ (break_statement)
+ (continue_statement)
+] @keyword.repeat
+
+"import" @keyword.import
+
+(field_expression
+ field: (identifier) @property)
+
+(call_expression
+ function: (identifier) @function.call)
+
+; Punctuations
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ","
+ ";"
+ ":"
+ "."
+] @punctuation.delimiter
+
+; Operators
+[
+ ; Field access
+ "->"
+ ; Range
+ ".."
+ ; Assignment
+ "="
+ "<<="
+ ">>="
+ "+="
+ "-="
+ "*="
+ "/="
+ "%="
+ "&="
+ "|="
+ "^="
+ ; Update
+ "--"
+ "++"
+ ; Arithmetic
+ "%"
+ "+"
+ "-"
+ "*"
+ "/"
+ ; Relational
+ "<="
+ "<"
+ ">="
+ ">"
+ "=="
+ "!="
+ ; Bitwise
+ "&"
+ "^"
+ "|"
+ "~"
+ "<<"
+ ">>"
+ ; Logical
+ "&&"
+ "||"
+ "!"
+] @operator
+
+(conditional_expression
+ [
+ "?"
+ ":"
+ ] @keyword.conditional.ternary)
+
+(predicate
+ "/" @punctuation.delimiter)
diff --git a/runtime/queries/bpftrace/injections.scm b/runtime/queries/bpftrace/injections.scm
new file mode 100644
index 000000000..8907d9f84
--- /dev/null
+++ b/runtime/queries/bpftrace/injections.scm
@@ -0,0 +1,12 @@
+([
+ (c_struct)
+ (c_preproc)
+ (c_preproc_block)
+] @injection.content
+ (#set! injection.language "c"))
+
+([
+ (line_comment)
+ (block_comment)
+] @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/c3/highlights.scm b/runtime/queries/c3/highlights.scm
index 1f02496b8..051245ebe 100644
--- a/runtime/queries/c3/highlights.scm
+++ b/runtime/queries/c3/highlights.scm
@@ -82,9 +82,7 @@
] @keyword
[
- "$alignof"
"$assert"
- "$assignable"
"$case"
"$default"
"$defined"
@@ -96,30 +94,19 @@
"$endif"
"$endswitch"
"$eval"
- "$evaltype"
"$error"
"$exec"
- "$extnameof"
"$feature"
"$for"
"$foreach"
"$if"
"$include"
- "$is_const"
- "$nameof"
- "$offsetof"
- "$qnameof"
- "$sizeof"
+ "$reflect"
"$stringify"
"$switch"
- "$typefrom"
- "$typeof"
- "$vacount"
- "$vatype"
- "$vaconst"
+ "$Typefrom"
+ "$Typeof"
"$vaarg"
- "$vaexpr"
- "$vasplat"
] @keyword.directive
"assert" @keyword.debug
@@ -218,6 +205,8 @@
"&&&"
"+++"
"|||"
+ "???"
+ "+++="
] @operator
(range_expr
@@ -232,6 +221,7 @@
(ternary_expr
[
"?"
+ "???"
":"
] @keyword.conditional.ternary)
@@ -268,8 +258,8 @@
(#any-of? @variable.builtin
"alignof" "associated" "elements" "extnameof" "from_ordinal" "get" "inf" "is_eq" "is_ordered"
"is_substruct" "len" "lookup" "lookup_field" "max" "membersof" "methodsof" "min" "nan" "inner"
- "kindof" "names" "nameof" "params" "paramsof" "parentof" "qnameof" "returns" "sizeof" "tagof"
- "has_tagof" "values" "typeid")))
+ "kindof" "names" "nameof" "params" "paramsof" "parentof" "qnameof" "returns" "sizeof" "set"
+ "tagof" "has_tagof" "values" "typeid")))
; Label
[
@@ -285,7 +275,7 @@
(path_ident
(ident) @module))
-(import_declaration
+(import_path
(path_ident
(ident) @module))
@@ -298,6 +288,9 @@
(call_inline_attributes
(at_ident) @attribute)
+(type_suffix
+ (at_ident) @attribute)
+
(asm_block_stmt
(at_ident) @attribute)
diff --git a/runtime/queries/c3/indents.scm b/runtime/queries/c3/indents.scm
index 61758ce32..7be7c88d6 100644
--- a/runtime/queries/c3/indents.scm
+++ b/runtime/queries/c3/indents.scm
@@ -23,13 +23,13 @@
(expr_stmt
";" @indent.end) @indent.begin
-(declaration
+(declaration_stmt
";" @indent.end) @indent.begin
-(const_declaration
+(return_stmt
";" @indent.end) @indent.begin
-(return_stmt
+(global_declaration
";" @indent.end) @indent.begin
(faultdef_declaration
diff --git a/runtime/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm
index 0c9489506..75aa3f847 100644
--- a/runtime/queries/c_sharp/highlights.scm
+++ b/runtime/queries/c_sharp/highlights.scm
@@ -327,6 +327,9 @@
(lambda_expression
type: (identifier) @type)
+(lambda_expression
+ (modifier) @keyword.modifier)
+
(as_expression
right: (identifier) @type)
diff --git a/runtime/queries/diff/highlights.scm b/runtime/queries/diff/highlights.scm
index 54c57a807..f878a54ab 100644
--- a/runtime/queries/diff/highlights.scm
+++ b/runtime/queries/diff/highlights.scm
@@ -10,6 +10,8 @@
(old_file)
] @diff.minus
+(change) @diff.delta
+
(commit) @constant
(location) @attribute
@@ -20,6 +22,10 @@
(filename) @string.special.path
+(special) @string.special
+
+"\\" @punctuation.special
+
(mode) @number
([
@@ -28,10 +34,13 @@
"++"
"+++"
"++++"
+ ">"
"-"
"--"
"---"
"----"
+ "<"
+ "!"
] @punctuation.special
(#set! priority 95))
diff --git a/runtime/queries/ecma/injections.scm b/runtime/queries/ecma/injections.scm
index 669c75671..69afb6d41 100644
--- a/runtime/queries/ecma/injections.scm
+++ b/runtime/queries/ecma/injections.scm
@@ -59,10 +59,15 @@
(#set! injection.include-children)
(#set! injection.language "groq"))
+; gql`...` or gql(`...`)
(call_expression
function: (identifier) @_name
(#eq? @_name "gql")
- arguments: (template_string) @injection.content
+ arguments: [
+ (arguments
+ (template_string) @injection.content)
+ (template_string) @injection.content
+ ]
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "graphql"))
diff --git a/runtime/queries/ecma/locals.scm b/runtime/queries/ecma/locals.scm
index adc58531d..97570e44a 100644
--- a/runtime/queries/ecma/locals.scm
+++ b/runtime/queries/ecma/locals.scm
@@ -25,6 +25,11 @@
name: (object_pattern
(shorthand_property_identifier_pattern) @local.definition.var))
+(variable_declarator
+ (object_pattern
+ (pair_pattern
+ (identifier) @local.definition.var)))
+
(import_specifier
(identifier) @local.definition.import)
diff --git a/runtime/queries/editorconfig/highlights.scm b/runtime/queries/editorconfig/highlights.scm
index feb0a524c..a1d686b36 100644
--- a/runtime/queries/editorconfig/highlights.scm
+++ b/runtime/queries/editorconfig/highlights.scm
@@ -1,14 +1,19 @@
(comment) @comment @spell
-(section
- (section_name) @string.special.path)
+(property) @property
-(character_choice
- (character) @constant)
+(string) @string
-(character_range
- start: (character) @constant
- end: (character) @constant)
+(header
+ (glob) @string.special.path)
+
+(character) @character
+
+(character_escape) @string.escape
+
+(wildcard) @character.special
+
+(integer) @number
[
"["
@@ -20,36 +25,11 @@
[
","
".."
- (path_separator)
+ "/"
+ "-"
] @punctuation.delimiter
[
- "-"
"="
- (negation)
+ "!"
] @operator
-
-[
- (wildcard_characters)
- (wildcard_any_characters)
- (wildcard_single_character)
-] @character.special
-
-(escaped_character) @string.escape
-
-(pair
- key: (identifier) @property
- value: (_) @string)
-
-(boolean) @boolean
-
-(integer) @number
-
-(unset) @constant.builtin
-
-[
- (spelling_language)
- (indent_style)
- (end_of_line)
- (charset)
-] @string.special
diff --git a/runtime/queries/enforce/highlights.scm b/runtime/queries/enforce/highlights.scm
index 35226202d..03ac68077 100644
--- a/runtime/queries/enforce/highlights.scm
+++ b/runtime/queries/enforce/highlights.scm
@@ -28,12 +28,12 @@
; Preprocessor directives
[
- (include)
- (define)
- (ifdef)
- (ifndef)
- (else)
- (endif)
+ (preproc_include)
+ (preproc_define)
+ (preproc_ifdef)
+ (preproc_ifndef)
+ (preproc_else)
+ (preproc_endif)
] @keyword.directive
(preproc_const) @constant.macro
diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm
index 549bceda0..da5c52a32 100644
--- a/runtime/queries/fish/highlights.scm
+++ b/runtime/queries/fish/highlights.scm
@@ -112,15 +112,16 @@
(command
name: (word) @function.call)
-; derived from builtin -n (fish 3.2.2)
+; derived from builtin -n (fish 4.3.3)
(command
name: [
(word) @function.builtin
(#any-of? @function.builtin
"." ":" "_" "abbr" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd"
"command" "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec"
- "exit" "fg" "functions" "history" "isatty" "jobs" "math" "path" "printf" "pwd" "random" "read"
- "realpath" "set" "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait")
+ "exit" "fg" "fish_indent" "fish_key_reader" "functions" "history" "isatty" "jobs" "math"
+ "path" "printf" "pwd" "random" "read" "realpath" "set" "set_color" "source" "status" "string"
+ "test" "time" "type" "ulimit" "wait")
])
; Functions
@@ -163,15 +164,15 @@
; Reference: https://fishshell.com/docs/current/language.html#special-variables
((variable_name) @variable.builtin
(#any-of? @variable.builtin
- "PATH" "CDPATH" "LANG" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" "LC_NUMERIC"
- "LC_TIME" "fish_color_normal" "fish_color_command" "fish_color_keyword" "fish_color_keyword"
- "fish_color_redirection" "fish_color_end" "fish_color_error" "fish_color_param"
- "fish_color_valid_path" "fish_color_option" "fish_color_comment" "fish_color_selection"
- "fish_color_operator" "fish_color_escape" "fish_color_autosuggestion" "fish_color_cwd"
- "fish_color_cwd_root" "fish_color_user" "fish_color_host" "fish_color_host_remote"
- "fish_color_status" "fish_color_cancel" "fish_color_search_match" "fish_color_history_current"
- "fish_pager_color_progress" "fish_pager_color_background" "fish_pager_color_prefix"
- "fish_pager_color_completion" "fish_pager_color_description"
+ "PATH" "CDPATH" "LANG" "LANGUAGE" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY"
+ "LC_NUMERIC" "LC_TIME" "fish_color_normal" "fish_color_command" "fish_color_keyword"
+ "fish_color_keyword" "fish_color_redirection" "fish_color_end" "fish_color_error"
+ "fish_color_param" "fish_color_valid_path" "fish_color_option" "fish_color_comment"
+ "fish_color_selection" "fish_color_operator" "fish_color_escape" "fish_color_autosuggestion"
+ "fish_color_cwd" "fish_color_cwd_root" "fish_color_user" "fish_color_host"
+ "fish_color_host_remote" "fish_color_status" "fish_color_cancel" "fish_color_search_match"
+ "fish_color_history_current" "fish_pager_color_progress" "fish_pager_color_background"
+ "fish_pager_color_prefix" "fish_pager_color_completion" "fish_pager_color_description"
"fish_pager_color_selected_background" "fish_pager_color_selected_prefix"
"fish_pager_color_selected_completion" "fish_pager_color_selected_description"
"fish_pager_color_secondary_background" "fish_pager_color_secondary_prefix"
@@ -183,8 +184,8 @@
"fish_cursor_visual" "fish_cursor_external" "fish_function_path" "fish_greeting" "fish_history"
"fish_trace" "FISH_DEBUG" "FISH_DEBUG_OUTPUT" "fish_user_paths" "umask" "BROWSER" "_" "argv"
"CMD_DURATION" "COLUMNS" "LINES" "fish_kill_signal" "fish_killring" "fish_read_limit" "fish_pid"
- "history" "HOME" "hostname" "IFS" "last_pid" "PWD" "pipestatus" "SHLVL" "status"
- "status_generation" "TERM" "USER" "EUID" "version" "FISH_VERSION"))
+ "fish_terminal_color_theme" "history" "HOME" "hostname" "IFS" "last_pid" "PWD" "pipestatus"
+ "SHLVL" "status" "status_generation" "TERM" "USER" "EUID" "version" "FISH_VERSION"))
; Nodes
[
diff --git a/runtime/queries/fortran/highlights.scm b/runtime/queries/fortran/highlights.scm
index 6a6dbba35..3217de113 100644
--- a/runtime/queries/fortran/highlights.scm
+++ b/runtime/queries/fortran/highlights.scm
@@ -259,17 +259,17 @@
] @operator
[
- "\\.and\\."
- "\\.or\\."
- "\\.eqv\\."
- "\\.neqv\\."
- "\\.lt\\."
- "\\.gt\\."
- "\\.le\\."
- "\\.ge\\."
- "\\.eq\\."
- "\\.ne\\."
- "\\.not\\."
+ ".and."
+ ".or."
+ ".eqv."
+ ".neqv."
+ ".lt."
+ ".gt."
+ ".le."
+ ".ge."
+ ".eq."
+ ".ne."
+ ".not."
] @keyword.operator
; Punctuation
diff --git a/runtime/queries/glimmer/injections.scm b/runtime/queries/glimmer/injections.scm
index 30b438682..9efa71f5e 100644
--- a/runtime/queries/glimmer/injections.scm
+++ b/runtime/queries/glimmer/injections.scm
@@ -3,19 +3,12 @@
(#set! injection.language "comment"))
; <style> tags
-((element_node
- (element_node_start
- (tag_name) @_tag_name
- (#eq? @_tag_name "style"))) @injection.content
- (#offset! @injection.content 0 7 0 -8)
- (#set! injection.language "css")
- (#set! injection.include-children))
+((style_element
+ (raw_text) @injection.content)
+ (#set! injection.language "css"))
; <script> tags
-((element_node
- (element_node_start
- (tag_name) @_tag_name
- (#eq? @_tag_name "script"))) @injection.content
- (#offset! @injection.content 0 8 0 -9)
- (#set! injection.language "glimmer_javascript")
+((script_element
+ (raw_text) @injection.content)
+ (#set! injection.language "javascript")
(#set! injection.include-children))
diff --git a/runtime/queries/glimmer_typescript/indents.scm b/runtime/queries/glimmer_typescript/indents.scm
index 237254d4c..ec026473f 100644
--- a/runtime/queries/glimmer_typescript/indents.scm
+++ b/runtime/queries/glimmer_typescript/indents.scm
@@ -1,3 +1,5 @@
+; inherits: typescript
+
(glimmer_opening_tag) @indent.begin
(glimmer_closing_tag) @indent.end
diff --git a/runtime/queries/gnuplot/folds.scm b/runtime/queries/gnuplot/folds.scm
new file mode 100644
index 000000000..52dd88006
--- /dev/null
+++ b/runtime/queries/gnuplot/folds.scm
@@ -0,0 +1 @@
+(cmd_do) @fold
diff --git a/runtime/queries/gnuplot/highlights.scm b/runtime/queries/gnuplot/highlights.scm
index 884c7263d..c648f1e9b 100644
--- a/runtime/queries/gnuplot/highlights.scm
+++ b/runtime/queries/gnuplot/highlights.scm
@@ -1,48 +1,46 @@
; highlights.scm
(comment) @comment @spell
+"variable" @variable.parameter
+
+; built-in named values (palette presets, special colour names).
+; `bgnd` and `background` are gnuplot synonyms for the same colour; both are
+; separate literals in the grammar, so both need naming here.
+[
+ "viridis"
+ "black"
+ "bgnd"
+ "background"
+] @variable.parameter.builtin
+
(identifier) @variable
[
- "-"
- "+"
- "~"
- "!"
- "$"
- "|"
- "**"
- "*"
- "/"
- "%"
- "=="
- "!="
- "<"
- "<="
- ">"
- ">="
- "<<"
- ">>"
- "&"
- "^"
- "&&"
- "||"
+ "["
+ "]"
+ "("
+ ")"
+ "{"
+ "}"
+] @punctuation.bracket
+
+(operator) @operator
+
+[
"="
","
- "."
+ ":"
+ ; datablock heredoc (`$data << EOD`) and the left-shift operator share one
+ ; token, so this capture covers both roles
+ "<<"
] @operator
-[
- "eq"
- "ne"
-] @keyword.operator
+; open range end — `set xrange [*:*]`, `array A[*]`: a wildcard, not a product
+"*" @character.special
-(ternary_expression
- [
- "?"
- ":"
- ] @keyword.conditional.ternary)
+(keyword_op) @keyword.operator
-"sum" @function.builtin
+(ternary_op) @keyword.conditional.ternary
[
"for"
@@ -51,598 +49,387 @@
"while"
] @keyword.repeat
+; -----------------------------------------------------------------------
+; Commands
+"cmd" @keyword
+
+; pseudo plot-elements: they fill an element slot but name no data source
[
- (c_break)
- (c_cd)
- (c_clear)
- "evaluate"
- "fit"
- "help"
- "load"
- "lower"
- "print"
- (c_replot)
- (c_reread)
- "reset"
- "splot"
- "cmd"
- "test"
- "undefine"
- "vfill"
+ "newhistogram"
+ "newspiderplot"
+ "keyentry"
] @keyword
-(c_pause
- "pause" @keyword
- "mouse" @variable.member
- _? @attribute
- (","
- _ @attribute)?)
-
-(c_plot
- "plot" @keyword)
-
-(c_show
- "show" @keyword
- "plot"? @attribute)
-
-(c_stats
- "stats" @keyword
- ("name"
- (_))? @variable.member)
-
+; connector words. `kw_fn` is the alias tier (at/via/from/to/by); `inverse`
+; (set link) and `sample` (plot sample) read the same way in their clause.
[
- "via"
"inverse"
"sample"
+ "kw_fn"
] @keyword.function
-[
- "if"
- "else"
-] @keyword.conditional
+"kw_cond" @keyword.conditional
-(plot_element
- "axes"? @variable.member)
-
-(cntrparam
- "auto"? @variable.member)
-
-(colorbox
- "origin"? @attribute)
-
-(contourfill
- "auto"? @variable.member)
-
-(format
- _? @attribute
- (_)
- _? @attribute)
-
-(key
- "auto"? @variable.member)
+[
+ "front"
+ "back"
+ "depthorder"
+ "clip"
+ "zclip"
+ "filled"
+ "nofilled"
+ ; coordinate systems (first/second/graph/screen/character/polar) — alias "coord"
+ "coord"
+] @keyword.directive
-(style ; TODO: complete
- [
- "arrow"
- "boxplot"
- ("data"
- [
- (_)
- "spiderplot" @attribute
- ])
- "fs"
- "function"
- "line"
- "circle"
- "rectangle"
- "ellipse"
- "parallelaxis"
- ; (spiderplot) ; TODO: complete
- "textbox"
- ("watchpoint"
- "labels" @attribute
- (_)?)
- ] @variable.member)
+; on/off toggle flags ({no}X) — alias "flag"
+"flag" @keyword.directive
-(terminal
- "name" @variable.member)
+; enumerated VALUES / modes (alias "mod")
+"mod" @constant
-; TODO: complete terminals in grammar and then simplify its options here
-(t_cairolatex
- [
- "eps"
- "pdf"
- "png"
- "standalone"
- "input"
- "blacktext"
- "colortext"
- "colourtext"
- ("header"
- (_))
- "mono"
- "color"
- "background"
- "rounded"
- "butt"
- ]* @attribute)
+; binary rotate= angle-unit suffixes (rotate=90deg / rotate=0.5 pi);
+; the attached form 0.5pi folds into the number token instead
+[
+ "degrees"
+ "pi"
+] @constant
-; (t_canvas)
-; (t_cgm)
-; (t_context)
-; (t_domterm)
-; (t_dumb)
-; (t_dxf)
-; (t_emf)
-; (t_epscairo)
-; (t_epslatex)
-; (t_fig)
-; (t_gif)
-; (t_hpgl)
-; (t_jpeg)
-; (t_lua)
-; (t_pc15)
-; (t_pdfcairo)
-; (t_png)
-; (t_pngcairo)
-; (t_postscript)
-; (t_pslatex)
-; (t_pstricks)
-; (t_qt)
-; (t_sixelgd)
-; (t_svg [(font_spec)]* @attribute)
-; (t_tek4xxx)
-; (t_texdraw)
-; (t_tikz)
-; (t_tkcanvas)
-(plot_style
- [
- "lines"
- "points"
- "lp"
- "financebars"
- "dots"
- "impulses"
- "labels"
- "surface"
- "steps"
- "fsteps"
- "histeps"
- "arrows"
- "vectors"
- "sectors"
- "contourfill"
- "errorbar"
- "errorlines"
- "parallelaxes"
- "boxes"
- "boxerrorbars"
- "boxxyerror"
- "isosurface"
- "boxplot"
- "candlesticks"
- "circles"
- "zerrorfill"
- "ellipses"
- "filledcurves"
- "fillsteps"
- "histograms"
- "image"
- "spiderplot"
- "pm3d"
- "rgbalpha"
- "rgbimage"
- "polygons"
- "table"
- "mask"
- ] @attribute)
+; plot/splot ELEMENT modifiers (alias "attr") — @property
+; (title/notitle/with/using/index/every/axes/smooth in a plot command;
+; distinct from set-option names which are @variable.member)
+"attr" @property
+; -----------------------------------------------------------------------
[
- "tc"
+ ; Terminal output path
+ "name"
+ ; Style attribute shorthands (K constants + datafile keywords)
+ "sa"
+ "dt"
"fc"
"fs"
"lc"
- "ls"
- "lw"
"lt"
- "pt"
"ps"
- "pi"
- "pn"
- "dt"
- "as"
- "start"
- "cycles"
- "saturation"
- "interval"
- "format"
- "keywidth"
- "samplen"
- "columns"
+ "pt"
+ "tc"
+ "skip"
+ "expand"
"title"
- "notitle"
- "every"
- "index"
- "using"
- "with"
- "frac"
- "cb"
+ ; set/show/unset option heads (alias "opt") and option-body suboption
+ ; keywords (alias "arg") — distinct clause families, same visual group
+ "opt"
"arg"
- "prefix"
- "output"
- "primary"
- "specular"
- "spec2"
- "firstlinetype"
- "width"
- "height"
- "expand"
- "array"
- "dx"
- "dy"
- "dz"
- "filetype"
- "center"
- "record"
] @variable.member
-; Workaround because formatter cannot handle 300 list nodes
+; -----------------------------------------------------------------------
+; Option keywords
[
- (angles)
- (clip)
- (colorsequence)
- (contour)
- (encoding)
- (mapping)
- (xdata)
- (theta)
- "wall"
- "on"
- "off"
- "opaque"
- "inside"
- "outside"
- "margin"
- "cen"
- "lef"
- "rig"
- "top"
- "bot"
- "lr"
- "a"
- "maxcols"
- "maxrows"
- "autojustify"
- "overlap"
- "spread"
- "wrap"
- "swarm"
- "range"
- "label"
- "mixed"
- "triangles"
- "insidecolor"
- "noinsidecolor"
- "cycle"
- "tics"
- "ztics"
- "cbtics"
- "user"
- "front"
- "back"
- "bdefault"
- "time"
- "palette"
- "terminal"
- "onecolor"
- "invert"
- "reverse"
- "writeback"
- "extend"
- "restore"
- "linear"
- "cubicspline"
- "bspline"
- "points"
- "order"
- "levels"
- "sorted"
- "autofreq"
- "add"
- "inout"
- "axis"
- "mirror"
- "type"
- "rowsfirst"
- "columnsfirst"
- "downwards"
- "upwards"
- "prevnext"
- "gray"
- "color"
- "gamma"
- "defined"
- "cubehelix"
- "model"
- "maxcolors"
- "file"
- "colormap"
- "rgbformulae"
- "viridis"
- "positive"
- "negative"
- "nops_allcF"
- "ps_allcF"
- "quiet"
- "full"
- "trip"
- "numbers"
- "small"
- "large"
- "fullwidth"
- "append"
- "bind"
- "errors"
- "session"
- "behind"
- "polar"
- "layerdefault"
- "locale"
- "axes"
- "fix"
- "keepfix"
- "noextend"
- "head"
- "fixed"
- "filled"
- "nofilled"
- "absolute"
- "at"
- "relative"
- "enhanced"
- "border"
- "noborder"
- "rgbcolor"
- "empty"
- "black"
- "bgnd"
- "nodraw"
- "size"
- "new"
- "first"
- "second"
- "screen"
- "graph"
- "character"
- "trianglepattern"
- "undefined"
- "noundefined"
- "altdiagonal"
- "bentover"
- "vertical"
- "horizontal"
- "square"
- "ratio"
- "noratio"
- "solid"
- "transparent"
- "pattern"
- "from"
- "to_rto"
- "length"
- "angle"
- "columnheaders"
- "fortran"
- "nofpe_trap"
- "missing"
- "separator"
- "commentschars"
- "log"
- "rangelimited"
- "offset"
- "nooffset"
- "scale"
- "font"
- "point"
- "nopoint"
- "boxed"
- "noboxed"
- "hypertext"
- "defaults"
- "keyentry"
- "splines"
- "qnorm"
- "gauss"
- "cauchy"
- "exp"
- "box"
- "hann"
- "implicit"
- "explicit"
- "rotate"
- "by"
- "parallel"
- "norotate"
- "map"
- "projection"
- "equal"
- "azimuth"
- "nohidden3d"
- "nocontours"
- "nosurface"
- "colornames"
- "functions"
- "variables"
- "version"
- "nologfile"
- "logfile"
- "fit_out"
- "errorvariables"
- "covariancevariables"
- "errorscaling"
- "prescale"
- "maxiter"
- "limit"
- "limit_abs"
- "start-lambda"
- "lambda-factor"
- "script"
- "clip"
- "fontscale"
- "lighting"
- "depthorder"
- "interpolate"
- "corners2color"
- "flush"
- "scanorder"
- "hidden3d"
- "clipcb"
- "layout"
- "margins"
- "spacing"
- "smooth"
- "binary"
- "skip"
- "bins"
- "binrange"
- "binwidth"
- "binvalue"
- "mask"
- "convexhull"
- "concavehull"
- "volatile"
- "zsort"
- "nonuniform"
- "sparse"
- "matrix"
-] @attribute
-
-[
- "x1"
- "x2"
- "y1"
- "y2"
- "y"
- "r"
- "z"
- "xy"
- "xz"
- "yz"
- "xyz"
- "x1y1"
- "x2y2"
- "x1y2"
- "x2y1"
- "columnheader"
- "seconds"
- "minutes"
- "hours"
- "days"
- "weeks"
- "months"
- "years"
- "cm"
- "in"
- "discrete"
- "incremental"
- "default"
- "long"
- "nogrid"
- "unique"
- "frequency"
- "fnormal"
- "cumulative"
- "cnormal"
- "csplines"
- "acsplines"
- "mcsplines"
- "path"
- "bezier"
- "sbezier"
- "unwrap"
- "kdensity"
+ ; coordinate systems / axes
+ "axes_opts"
+ ; time units (set xdata time / timefmt)
+ ; smooth subtypes still emitted as own token (value-modes csplines/bezier/… → "mod")
"closed"
"between"
"above"
"below"
- "variable"
+ ; plot / datafile misc
"pixels"
- "RGB"
- "CMY"
- "HSV"
+ "whiskerbars"
+ "beginning"
+ "long"
+ ; positioning / key
"base"
"begin"
"center"
"end"
- "ftriangles"
+ ; pm3d / 3d options
"clip1in"
"clip4in"
"c2c"
"retrace"
+ ; data separators
"whitespace"
"tab"
"comma"
+ ; palette stack
"push"
"pop"
+ ; flip binary axes
"flipx"
"flipy"
"flipz"
+ ; binary datafile modifiers
+ "binary"
+ "format"
+ "filetype"
+ "record"
+ "array"
+ "origin"
+ "dx"
+ "dy"
+ "level"
+ "matrix"
+ "columnheaders"
+ "rowheaders"
+ "nonuniform"
+ "sparse"
+ "volatile"
+ "noautoscale"
+ "zsort"
+ "mask"
+ "sharpen"
+ "transpose"
+ ; endian options (binary)
+ "endian"
+ "little"
+ "big"
+ "swap"
+ "swab"
+ "middle"
+ "pdp"
+ ; fit modifiers
+ "unitweights"
+ "errors"
+ ; command-argument keywords (exit forms, pause mouse)
+ ; the `pause` end conditions themselves are `mod` tier
+ "message"
+ "status"
+ "mouse"
+ ; history command options
+ "append"
+ "quiet"
+ "numbers"
+ "trim"
+ "full"
+ ; pixmap
+ ; coordinate axis-family prefix (the coord systems first/second/graph/screen/
+ ; character/polar are aliased to (coord) -> @keyword.directive below)
+ "axis"
+ ; position direction aliases
+ "cen"
+ "lef"
+ "rig"
+ ; geometry / arrow options
+ "angle"
+ "length"
+ "head"
+ ; offset / scale
+ "offset"
+ "scale"
+ ; orientation
+ ; angle units
+ ; contour / palette / axis
+ "range"
+ "missing"
+ "interpolate"
+ ; rotation
+ "rotate"
+ ; border / extend / range modifiers
+ "restore"
+ ; pm3d
+ "scanorder"
+ "position"
+ ; histogram subtypes
+ ; smooth additions
+ ; key/label placement
+ ; fill pattern
+ "pattern"
+ ; data / fit extras
+ "variables"
+ "datablocks"
+ "commentschars"
+ "functions"
+ ; save changes
+ "changes"
+ ; misc
+ ; coordinate planes / walls
+ ; colorspec
+ "rgbcolor"
+ ; tics
+ ; set size
+ ; set fit
+ "default"
+ ; label / style
+ ; set view
+ "map"
+ ; set theta direction
+ ; palette model / presets / cubehelix options
+ "model"
+ ; pm3d / lighting
+ "corners2color"
+ "primary"
+ "specular"
+ "spec2"
+ "rot_x"
+ "rot_z"
+ "Phong"
+ ; dgrid3d subtype (gauss/… value-modes → "mod")
+ ; contour / cntrparam
+ ; tics axes / modifiers
+ ; text / font / encoding
+ ; fill / size style
+ "empty"
+ ; layout / spacing / multiplot
+ "layout"
+ "spacing"
+ "frac"
+ ; watch-label / surface options
+ "point"
+ ; tics keyword (grid / paxis — covers xtics, ytics, ztics contexts)
+ "tics"
+ ; histogram fill style
+ ; jitter options
+ ; key command options
+ ; paxis label keyword (key("label",3) with default aka="label")
+ "label"
+ ; polar coordinate system and grid option
+ ; polar grid axis ranges
+ ; ellipses style
+ "units"
+ ; stats output prefix
+ "prefix"
+ ; palette formula option
+ ; grid mode
+ ; datafile option
+ ; textbox / multiplot margins (anonymous "margins" string)
+ "margins"
+ ; datafile lc/fc palette shorthand
+ "palette"
+ ; set fit quiet / results / verbose / brief
] @variable.member
-(colorspec
- "palette" @attribute)
-
-(datafile_modifiers
- "origin"? @variable.member)
+; -----------------------------------------------------------------------
+; Presentation / style attributes
+[
+ "size"
+ "monochrome"
+ "color"
+ "transparent"
+ ; palette colour models (set palette model)
+ "RGB"
+ "CMY"
+ "HSV"
+ "nobackground"
+ "separator"
+ (hull)
+ "units_opt"
+ ; fill / line style modes
+ "solid"
+ ; page orientation
+ ; terminal options
+ "animate"
+ "input"
+ ; point type names (ps/tikz terminals)
+ ; key alignment (capitalised)
+ ; layer / style misc
+ "st_opt"
+ "plt_st"
+] @attribute
-((datafile_modifiers
- filetype: (identifier) @variable.member)
- (#any-of? @variable.member
- "avs" "bin" "edf" "ehf" "gif" "gpbin" "jpeg" "jpg" "png" "raw" "rgb" "auto"))
+; binary filetype= value (png/jpg/gif/bin parsed as identifier in field)
+(binary_options
+ filetype: (identifier) @attribute)
+; -----------------------------------------------------------------------
+; Macro / datablock identifiers
(macro) @function.macro
-(datablock) @function.macro
+(datablock) @module
+
+[
+ (datablock_start)
+ (datablock_end)
+] @label
+; -----------------------------------------------------------------------
+; Functions
(function
- name: (identifier) @function)
+ name: (identifier) @function.call)
+
+(def_func
+ .
+ (function
+ name: (identifier) @function))
((function
name: (identifier) @function.builtin)
(#any-of? @function.builtin
+ ; real / complex math
"abs" "acos" "acosh" "airy" "arg" "asin" "asinh" "atan" "atan2" "atanh" "besj0" "besj1" "besjn"
- "besy0" "besy1" "besyn" "besi0" "besi1" "besin" "cbrt" "ceil" "conj" "cos" "cosh" "EllipticK"
- "EllipticE" "EllipticPi" "erf" "erfc" "exp" "expint" "floor" "gamma" "ibeta" "inverf" "igamma"
- "imag" "int" "invnorm" "invibeta" "invigamma" "LambertW" "lambertw" "lgamma" "lnGamma" "log"
- "log10" "norm" "rand" "real" "round" "sgn" "sin" "sinh" "sqrt" "SynchrotronF" "tan" "tanh"
- "uigamma" "voigt" "zeta" "cerf" "cdawson" "faddeva" "erfi" "FresnelC" "FresnelS" "VP" "VP_fwhm"
- "Ai" "Bi" "BesselH1" "BesselH2" "BesselJ" "BesselY" "BesselI" "BesselK" "gprintf" "sprintf"
- "strlen" "strstrt" "substr" "strptime" "srtftime" "system" "trim" "word" "words" "time"
- "timecolumn" "tm_hour" "tm_mday" "tm_min" "tm_mon" "tm_sec" "tm_wday" "tm_week" "tm_yday"
- "tm_year" "weekday_iso" "weekday_cdc" "column" "columnhead" "exists" "hsv2rgb" "index" "palette"
- "rgbcolor" "stringcolumn" "valid" "value" "voxel"))
+ "besy0" "besy1" "besyn" "besi0" "besi1" "besin" "cbrt" "ceil" "conj" "cos" "cosh" "exp" "floor"
+ "imag" "int" "log" "log10" "norm" "rand" "real" "round" "sgn" "sin" "sinh" "sqrt" "tan" "tanh"
+ ; special functions
+ "EllipticK" "EllipticE" "EllipticPi" "erf" "erfc" "expint" "gamma" "ibeta" "igamma" "inverf"
+ "invibeta" "invigamma" "invnorm" "LambertW" "lgamma" "lnGamma" "SynchrotronF" "uigamma" "voigt"
+ "zeta"
+ ; libcerf
+ "cerf" "cdawson" "faddeeva" "erfi" "FresnelC" "FresnelS" "VP" "VP_fwhm"
+ ; libamos — complex Airy / Bessel
+ "Ai" "Bi" "BesselH1" "BesselH2" "BesselJ" "BesselY" "BesselI" "BesselK"
+ ; strings
+ "gprintf" "sprintf" "strlen" "strstrt" "substr" "split" "join" "trim" "word" "words" "system"
+ ; arrays
+ "index"
+ ; time
+ "time" "timecolumn" "strftime" "strptime" "tm_hour" "tm_mday" "tm_min" "tm_mon" "tm_sec"
+ "tm_wday" "tm_week" "tm_yday" "tm_year" "weekdate_iso" "weekdate_cdc"
+ ; using-specifier / plotting
+ "column" "columnhead" "stringcolumn" "strcol" "exists" "valid" "value" "hsv2rgb" "palette"
+ "rgbcolor" "voxel"))
+
+; bare `title columnheader` (the called form `columnheader(N)` is a (function)
+; and matches the builtin list above)
+(columnheader) @function.builtin
+
+; -----------------------------------------------------------------------
+; Built-in constants
+((identifier) @constant.builtin
+ (#any-of? @constant.builtin "pi" "NaN" "Inf"))
+; -----------------------------------------------------------------------
+; Built-in variables (stats output, GPVAL_*, ARG*, vfill loop vars)
((identifier) @variable.builtin
- (#match? @variable.builtin
- "^\\w+_(records|headers|outofrange|invalid|blank|blocks|columns|column_header|index_(min|max)(_x|_y)?|(min|max)(_x|_y)?|mean(_err)?(_x|_y)?|stddev(_err)?(_x|_y)?)$"))
+ (#match? @variable.builtin "^\\w+_(mean|stddev|skewness|kurtosis)(_err)?(_x|_y)?$"))
+; stats: distribution summaries (+_x/_y)
((identifier) @variable.builtin
- (#match? @variable.builtin
- "^\\w+_(sdd(_x|_y)?|(lo|up)_quartile(_x|_y)?|median(_x|_y)?|sum(sq)?(_x|_y)?|skewness(_err)?(_x|_y)?)$"))
+ (#match? @variable.builtin "^\\w+_(min|max|sdd|adev|median|sum(sq)?|(lo|up)_quartile)(_x|_y)?$"))
+; stats: regression, extents, counts, column metadata
((identifier) @variable.builtin
(#match? @variable.builtin
- "^\\w+_(kurtosis(_err)?(_x|_y)?|adev(_x|_y)?|correlation|slope(_err)?|intercept(_err)?|sumxy|pos(_min|_max)_y|size(_x|_y))$"))
+ "^\\w+_((slope|intercept)(_err)?|size(_x|_y)|column(s|_header)|records|headers|outofrange|invalid|blank|blocks|correlation|sumxy)$"))
+
+; GPVAL_* / MOUSE_* / FIT_* / ARG*
+((identifier) @variable.builtin
+ (#match? @variable.builtin "^((GPVAL|MOUSE|FIT)_|ARG)\\w+$"))
+; fixed-name built-ins — plain string comparison, never reaches a regex engine
((identifier) @variable.builtin
- (#match? @variable.builtin "^((GPVAL|MOUSE|FIT)_\\w+|GNUTERM|NaN|VoxelDistance|GridDistance|pi)$"))
+ (#any-of? @variable.builtin "GNUTERM" "VoxelDistance" "GridDistance"))
-(array_def
+; -----------------------------------------------------------------------
+; Array definitions
+(def_array
"array" @keyword.function)
(array
(identifier) @function)
+; -----------------------------------------------------------------------
+; Literals
+"NaN" @constant.builtin
+
(number) @number
(string_literal) @string
+
+(escape_sequence) @string.escape
+
+(format_specifier) @string.special
+
+; watchpoint target (`watch y=50`): the axis/expression name being watched
+(plot_element
+ target: (identifier) @variable.member)
diff --git a/runtime/queries/go/highlights.scm b/runtime/queries/go/highlights.scm
index 91a9d4d76..0251f3b5b 100644
--- a/runtime/queries/go/highlights.scm
+++ b/runtime/queries/go/highlights.scm
@@ -152,32 +152,28 @@
"panic" "print" "println" "real" "recover"))
; Delimiters
-"." @punctuation.delimiter
-
-"," @punctuation.delimiter
-
-":" @punctuation.delimiter
-
-";" @punctuation.delimiter
-
-"(" @punctuation.bracket
-
-")" @punctuation.bracket
-
-"{" @punctuation.bracket
-
-"}" @punctuation.bracket
-
-"[" @punctuation.bracket
+[
+ "."
+ ","
+ ":"
+ ";"
+] @punctuation.delimiter
-"]" @punctuation.bracket
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
; Literals
(interpreted_string_literal) @string
(raw_string_literal) @string
-(rune_literal) @string
+(rune_literal) @character
(escape_sequence) @string.escape
diff --git a/runtime/queries/haskell/highlights.scm b/runtime/queries/haskell/highlights.scm
index de0eaf0a1..d0fdc17f6 100644
--- a/runtime/queries/haskell/highlights.scm
+++ b/runtime/queries/haskell/highlights.scm
@@ -9,7 +9,8 @@
(_) @variable.parameter))
(expression/lambda
- (_)+ @variable.parameter
+ patterns: (patterns
+ (_) @variable.parameter)
"->")
(decl/function
@@ -226,7 +227,8 @@
(qualified
((module) @module
(variable) @function.call))
- ])
+ ]
+ operator: (operator))
; infix operators applied to variables
((expression/variable) @variable
@@ -245,7 +247,7 @@
(function
(infix
left_operand: [
- (variable) @variable
+ (variable) @variable.parameter
(qualified
((module) @module
(variable) @variable))
diff --git a/runtime/queries/hlsplaylist/highlights.scm b/runtime/queries/hlsplaylist/highlights.scm
deleted file mode 100644
index 9852aed6d..000000000
--- a/runtime/queries/hlsplaylist/highlights.scm
+++ /dev/null
@@ -1,41 +0,0 @@
-; Comments
-(comment) @comment @spell
-
-; General
-(uri) @string.special.url
-
-(tag_name) @keyword
-
-(attribute_name) @attribute
-
-[
- (dec)
- (hex)
- (resolution)
- (range)
-] @number
-
-(float) @number.float
-
-(string) @string
-
-[
- (enum)
- (date_time_msec)
-] @string.special
-
-(title) @markup.heading
-
-; Literals
-[
- "="
- "x"
- "@"
-] @operator
-
-[
- ":"
- ","
-] @punctuation.delimiter
-
-"#" @punctuation.special
diff --git a/runtime/queries/hlsplaylist/injections.scm b/runtime/queries/hlsplaylist/injections.scm
deleted file mode 100644
index 2f0e58eb6..000000000
--- a/runtime/queries/hlsplaylist/injections.scm
+++ /dev/null
@@ -1,2 +0,0 @@
-((comment) @injection.content
- (#set! injection.language "comment"))
diff --git a/runtime/queries/html_tags/highlights.scm b/runtime/queries/html_tags/highlights.scm
index 9eaf813be..94a338aa7 100644
--- a/runtime/queries/html_tags/highlights.scm
+++ b/runtime/queries/html_tags/highlights.scm
@@ -1,9 +1,11 @@
-(tag_name) @tag
+(tag_name) @tag @nospell
; (erroneous_end_tag_name) @error ; we do not lint syntax errors
(comment) @comment @spell
-(attribute_name) @tag.attribute
+(attribute_name) @tag.attribute @nospell
+
+(attribute_value) @nospell
((attribute
(quoted_attribute_value) @string)
diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm
index fd2030fa8..9829e75ea 100644
--- a/runtime/queries/jinja_inline/highlights.scm
+++ b/runtime/queries/jinja_inline/highlights.scm
@@ -49,14 +49,15 @@
] @keyword
[
- "endtrans"
- "endblock"
- "endwith"
- "endfilter"
- "endmacro"
- "endcall"
- "endset"
- "endautoescape"
+ (endtrans_statement)
+ (endblock_statement)
+ (endwith_statement)
+ (endfilter_statement)
+ (endmacro_statement)
+ (endcall_statement)
+ (endset_statement)
+ (endautoescape_statement)
+ "required"
] @keyword
(do_statement
@@ -74,9 +75,9 @@
[
"if"
- "else"
- "endif"
- "elif"
+ (else_statement)
+ (endif_statement)
+ (elif_block)
] @keyword.conditional
[
@@ -84,7 +85,7 @@
"in"
"continue"
"break"
- "endfor"
+ (endfor_statement)
] @keyword.repeat
"call" @function.call
diff --git a/runtime/queries/jjdescription/highlights.scm b/runtime/queries/jjdescription/highlights.scm
new file mode 100644
index 000000000..7c87c08be
--- /dev/null
+++ b/runtime/queries/jjdescription/highlights.scm
@@ -0,0 +1,42 @@
+[
+ (comment)
+ (generated_comment)
+] @comment
+
+(comment_content) @spell
+
+(subject) @markup.heading
+
+(type) @keyword
+
+(scope) @variable.parameter
+
+(change_id) @constant
+
+(filepath) @string.special.path
+
+((rest) @comment
+ (#not-lua-match? @comment "^diff"))
+
+"JJ: ignore-rest" @keyword.directive
+
+[
+ "("
+ ")"
+] @punctuation.bracket
+
+":" @punctuation.delimiter
+
+"!" @punctuation.special
+
+[
+ "A"
+ "C"
+] @diff.plus
+
+"D" @diff.minus
+
+[
+ "M"
+ "R"
+] @diff.delta
diff --git a/runtime/queries/jjdescription/injections.scm b/runtime/queries/jjdescription/injections.scm
new file mode 100644
index 000000000..538383a3d
--- /dev/null
+++ b/runtime/queries/jjdescription/injections.scm
@@ -0,0 +1,6 @@
+((comment_content) @injection.content
+ (#set! injection.language "comment"))
+
+((rest) @injection.content
+ (#lua-match? @injection.content "^diff")
+ (#set! injection.language "diff"))
diff --git a/runtime/queries/kos/folds.scm b/runtime/queries/kos/folds.scm
new file mode 100644
index 000000000..ca51a5406
--- /dev/null
+++ b/runtime/queries/kos/folds.scm
@@ -0,0 +1,19 @@
+[
+ (function_decl)
+ (constructor_literal)
+ (function_literal)
+ (class_decl)
+ (class_literal)
+ (do_statement)
+ (if_statement)
+ (try_statement)
+ (defer_statement)
+ (with_statement)
+ (switch_statement)
+ (switch_case)
+ (default_case)
+ (loop_statement)
+ (repeat_statement)
+ (while_statement)
+ (for_statement)
+] @fold
diff --git a/runtime/queries/kos/highlights.scm b/runtime/queries/kos/highlights.scm
new file mode 100644
index 000000000..07757d2e3
--- /dev/null
+++ b/runtime/queries/kos/highlights.scm
@@ -0,0 +1,156 @@
+(hash_bang) @keyword.directive
+
+(comment) @comment @spell
+
+(number) @number
+
+(float_number) @number.float
+
+(identifier) @variable
+
+(parameter
+ parameter: (identifier) @variable.parameter)
+
+(property_identifier) @property
+
+[
+ (string_literal)
+ (string_literal_begin)
+ (string_literal_continuation)
+ (string_literal_end)
+] @string
+
+[
+ "case"
+ "default"
+ "else"
+ "if"
+ "switch"
+] @keyword.conditional
+
+"import" @keyword.import
+
+[
+ (break_statement)
+ (continue_statement)
+ "for"
+ "loop"
+ "repeat"
+ "while"
+] @keyword.repeat
+
+(for_statement
+ "in" @keyword.repeat)
+
+"class" @keyword.type
+
+[
+ "return"
+ "yield"
+] @keyword.return
+
+[
+ "catch"
+ "defer"
+ "throw"
+ "try"
+] @keyword.exception
+
+[
+ "constructor"
+ "fun"
+ "=>"
+] @keyword.function
+
+"_" @character.special
+
+[
+ (line)
+ "assert"
+ ;"async"
+ "const"
+ "do"
+ "extends"
+ (fallthrough_statement)
+ ;"get"
+ ;"match"
+ "public"
+ ;"set"
+ ;"static"
+ "var"
+ "with"
+] @keyword
+
+[
+ (this)
+ (super)
+] @variable.builtin
+
+[
+ (false)
+ (true)
+] @boolean
+
+(void) @constant.builtin
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+(string_literal_begin
+ "\\(" @punctuation.special)
+
+(string_literal_continuation
+ "\\(" @punctuation.special)
+
+(formatted_string
+ ")" @punctuation.special)
+
+[
+ ";"
+ ":"
+ "."
+ ","
+] @punctuation.delimiter
+
+[
+ (arithmetic_assignment_operator)
+ (comparison_operator)
+ (bitwise_operator)
+ (additive_operator)
+ (multiplicative_operator)
+ (logical_operator)
+ (unary_operator)
+ "->"
+ "..."
+ "="
+ "?"
+] @operator
+
+(conditional_expression
+ [
+ "?"
+ ":"
+ ] @keyword.conditional.ternary)
+
+(class_member
+ (function_decl
+ name: (identifier) @function.method))
+
+(function_decl
+ name: (identifier) @function)
+
+(class_decl
+ name: (identifier) @type)
+
+(invocation
+ (identifier) @function.call)
+
+(invocation
+ (refinement
+ property: (property_identifier) @function.method.call))
diff --git a/runtime/queries/kos/injections.scm b/runtime/queries/kos/injections.scm
new file mode 100644
index 000000000..2677f272b
--- /dev/null
+++ b/runtime/queries/kos/injections.scm
@@ -0,0 +1,6 @@
+(((comment) @_jsdoc_comment
+ (#lua-match? @_jsdoc_comment "^/[*][*][^*].*[*]/$")) @injection.content
+ (#set! injection.language "jsdoc"))
+
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/kos/locals.scm b/runtime/queries/kos/locals.scm
new file mode 100644
index 000000000..37f14f4e6
--- /dev/null
+++ b/runtime/queries/kos/locals.scm
@@ -0,0 +1,41 @@
+; Scopes
+;-------
+(compound_statement) @local.scope
+
+(for_statement) @local.scope
+
+(function_decl) @local.scope
+
+(constructor_literal) @local.scope
+
+(function_literal) @local.scope
+
+(with_statement) @local.scope
+
+(catch_clause) @local.scope
+
+; Definitions
+;------------
+(variable_decl
+ variable: (identifier) @local.definition.var)
+
+(parameter
+ parameter: (identifier) @local.definition.parameter)
+
+(import
+ module: (identifier) @local.definition.import)
+
+(import
+ symbol: (identifier) @local.definition.import)
+
+(function_decl
+ name: (identifier) @local.definition.function
+ (#set! definition.var.scope parent))
+
+(class_decl
+ name: (identifier) @local.definition.type
+ (#set! definition.var.scope parent))
+
+; References
+;------------
+(identifier) @local.reference
diff --git a/runtime/queries/kotlin/highlights.scm b/runtime/queries/kotlin/highlights.scm
index 8eda6ef61..0383b2ee1 100644
--- a/runtime/queries/kotlin/highlights.scm
+++ b/runtime/queries/kotlin/highlights.scm
@@ -153,7 +153,7 @@
"charArrayOf" "emptyArray" "mapOf" "setOf" "listOf" "emptyMap" "emptySet" "emptyList"
"mutableMapOf" "mutableSetOf" "mutableListOf" "print" "println" "error" "TODO" "run"
"runCatching" "repeat" "lazy" "lazyOf" "enumValues" "enumValueOf" "assert" "check"
- "checkNotNull" "require" "requireNotNull" "with" "suspend" "synchronized"))
+ "checkNotNull" "require" "requireNotNull" "with" "synchronized"))
; Literals
[
@@ -343,12 +343,11 @@
"?:"
"!!"
"is"
- "!is"
"in"
- "!in"
"as"
"as?"
".."
+ "..<"
"->"
] @operator
@@ -389,10 +388,6 @@
; NOTE: `interpolated_identifier`s can be highlighted in any way
(string_literal
- "$" @punctuation.special
- (interpolated_identifier) @none @variable)
-
-(string_literal
- "${" @punctuation.special
+ (interpolation_expression_start) @punctuation.special
(interpolated_expression) @none
- "}" @punctuation.special)
+ (interpolation_expression_end) @punctuation.special)
diff --git a/runtime/queries/kotlin/injections.scm b/runtime/queries/kotlin/injections.scm
index b2bc233ff..a9bffab7b 100644
--- a/runtime/queries/kotlin/injections.scm
+++ b/runtime/queries/kotlin/injections.scm
@@ -8,7 +8,8 @@
; - "[abc]?".toRegex()
(call_expression
(navigation_expression
- ((string_literal) @injection.content
+ ((string_literal
+ (string_content) @injection.content)
(#set! injection.language "regex"))
(navigation_suffix
((simple_identifier) @_function
@@ -21,7 +22,8 @@
(call_suffix
(value_arguments
(value_argument
- (string_literal) @injection.content
+ (string_literal
+ (string_content) @injection.content)
(#set! injection.language "regex")))))
; - Regex.fromLiteral("[abc]?")
@@ -35,13 +37,15 @@
(call_suffix
(value_arguments
(value_argument
- (string_literal) @injection.content
+ (string_literal
+ (string_content) @injection.content)
(#set! injection.language "regex")))))
; "pi = %.2f".format(3.14159)
((call_expression
(navigation_expression
- (string_literal) @injection.content
+ (string_literal
+ (string_content) @injection.content)
(navigation_suffix
(simple_identifier) @_method)))
(#eq? @_method "format")
diff --git a/runtime/queries/lua/injections.scm b/runtime/queries/lua/injections.scm
index e76745f4f..8f371c9ed 100644
--- a/runtime/queries/lua/injections.scm
+++ b/runtime/queries/lua/injections.scm
@@ -34,10 +34,10 @@
(_)
.
(string
- content: _ @_method)
+ content: (_) @_method)
.
(string
- content: _ @injection.content)))
+ content: (_) @injection.content)))
(#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify")
(#eq? @_method "nvim_exec_lua")
(#set! injection.language "lua"))
diff --git a/runtime/queries/make/highlights.scm b/runtime/queries/make/highlights.scm
index 8d182c026..b4ef14cb1 100644
--- a/runtime/queries/make/highlights.scm
+++ b/runtime/queries/make/highlights.scm
@@ -167,6 +167,7 @@
"eval"
"file"
"value"
+ "let"
] @function.builtin)
"\\" @punctuation.special
diff --git a/runtime/queries/markdown_inline/highlights.scm b/runtime/queries/markdown_inline/highlights.scm
index 5fb9e911d..a0cafee67 100644
--- a/runtime/queries/markdown_inline/highlights.scm
+++ b/runtime/queries/markdown_inline/highlights.scm
@@ -10,10 +10,15 @@
(shortcut_link
(link_text) @nospell)
-[
- (backslash_escape)
- (hard_line_break)
-] @string.escape
+; Conceal backslash in backslash escapes
+((backslash_escape) @conceal
+ (#offset! @conceal 0 0 0 -1)
+ (#set! conceal ""))
+
+; Conceal backslash in hard line breaks
+((hard_line_break
+ "\\" @conceal)
+ (#set! conceal ""))
; Conceal codeblock and text style markers
([
diff --git a/runtime/queries/muttrc/highlights.scm b/runtime/queries/muttrc/highlights.scm
deleted file mode 100644
index 27754cc53..000000000
--- a/runtime/queries/muttrc/highlights.scm
+++ /dev/null
@@ -1,55 +0,0 @@
-; Comments
-(comment) @comment @spell
-
-; General
-(int) @number
-
-(string) @string
-
-[
- (map)
- (object)
- (composeobject)
- (color)
- (attribute)
-] @string.special
-
-(quadoption) @boolean
-
-(path) @string.special.path
-
-(regex) @string.regexp
-
-(option) @variable
-
-(command_line_option) @variable.builtin
-
-((option) @variable.builtin
- (#not-lua-match? @variable.builtin "^my_"))
-
-(command) @keyword
-
-(source_directive
- (command) @keyword.import)
-
-(uri) @string.special.url
-
-(key_name) @constant.builtin
-
-(escape) @string.escape
-
-(function) @function.call
-
-; Literals
-[
- "<"
- ">"
-] @punctuation.bracket
-
-"," @punctuation.delimiter
-
-[
- "&"
- "?"
- "*"
-] @character.special
diff --git a/runtime/queries/muttrc/injections.scm b/runtime/queries/muttrc/injections.scm
deleted file mode 100644
index 9c16ad15a..000000000
--- a/runtime/queries/muttrc/injections.scm
+++ /dev/null
@@ -1,8 +0,0 @@
-((regex) @injection.content
- (#set! injection.language "regex"))
-
-((shell) @injection.content
- (#set! injection.language "bash"))
-
-((comment) @injection.content
- (#set! injection.language "comment"))
diff --git a/runtime/queries/nickel/highlights.scm b/runtime/queries/nickel/highlights.scm
index c5ebfe166..2f563e9f8 100644
--- a/runtime/queries/nickel/highlights.scm
+++ b/runtime/queries/nickel/highlights.scm
@@ -1,5 +1,8 @@
(comment) @comment @spell
+(annot_atom
+ doc: (static_string) @spell)
+
[
"forall"
"in"
@@ -7,6 +10,10 @@
"default"
"doc"
"rec"
+ "optional"
+ "priority"
+ "force"
+ "not_exported"
] @keyword
"fun" @keyword.function
@@ -23,20 +30,54 @@
(types) @type
-"Array" @type.builtin
+[
+ "Array"
+ "Number"
+ "Dyn"
+ "Bool"
+ "String"
+] @type.builtin
; BUILTIN Constants
(bool) @boolean
"null" @constant.builtin
+(enum_tag) @constant
+
(num_literal) @number
-(infix_op) @operator
+[
+ (infix_op)
+ "|>"
+ "="
+ "&"
+ "&&"
+ "||"
+ "=="
+ "+"
+ "-"
+ "*"
+ "/"
+ "%"
+ "!"
+ "?"
+ "!="
+ "<"
+ "<="
+ ">"
+ ">="
+ "@"
+ ".."
+ "=>"
+ "++"
+] @operator
+
+"or" @keyword.operator
(type_atom) @type
-(enum_tag) @variable
+(static_string) @string
(chunk_literal_single) @string
@@ -51,24 +92,60 @@
")"
"[|"
"|]"
+ "["
+ "]"
] @punctuation.bracket
-(multstr_start) @punctuation.bracket
-
-(multstr_end) @punctuation.bracket
+[
+ ","
+ "."
+ ":"
+ ";"
+ "|"
+ "->"
+] @punctuation.delimiter
-(interpolation_start) @punctuation.bracket
+(multstr_start) @string
-(interpolation_end) @punctuation.bracket
+(multstr_end) @string
-(field_decl) @variable.member
+[
+ (interpolation_start)
+ (interpolation_end)
+] @punctuation.special
(builtin) @function.builtin
+(builtin
+ "%" @function.builtin)
+
(fun_expr
pats: (pattern_fun
(ident) @variable.parameter))
+; application where the head terms is an identifier: function arg1 arg2 arg3
+(applicative
+ t1: (applicative
+ .
+ (record_operand
+ (atom
+ (ident))) @function))
+
+; application where the head terms is a record field path: foo.bar.function arg1 arg2 arg3
(applicative
t1: (applicative
- (record_operand) @function))
+ .
+ (record_operand
+ (record_operation_chain)) @function))
+
+(str_chunks) @string
+
+(field_path_elem) @property
+
+(infix_expr
+ op: (infix_b_op_6)
+ t2: (infix_expr
+ (applicative
+ .
+ (record_operand
+ (record_operation_chain) @function))))
diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm
index 718a9c1c5..c1593b91f 100644
--- a/runtime/queries/nix/injections.scm
+++ b/runtime/queries/nix/injections.scm
@@ -48,7 +48,8 @@
((string_fragment) @injection.content
(#set! injection.language "bash")))
]
- (#lua-match? @_path "^%a+Phase$"))
+ (#lua-match? @_path "^%a+Phase$")
+ (#set! injection.combined))
(binding
attrpath: (attrpath
@@ -61,7 +62,8 @@
((string_fragment) @injection.content
(#set! injection.language "bash")))
]
- (#lua-match? @_path "^pre%a+$"))
+ (#lua-match? @_path "^pre%a+$")
+ (#set! injection.combined))
(binding
attrpath: (attrpath
@@ -74,7 +76,8 @@
((string_fragment) @injection.content
(#set! injection.language "bash")))
]
- (#lua-match? @_path "^post%a+$"))
+ (#lua-match? @_path "^post%a+$")
+ (#set! injection.combined))
(binding
attrpath: (attrpath
@@ -87,7 +90,8 @@
((string_fragment) @injection.content
(#set! injection.language "bash")))
]
- (#lua-match? @_path "^script$"))
+ (#lua-match? @_path "^script$")
+ (#set! injection.combined))
(apply_expression
function: (_) @_func
diff --git a/runtime/queries/problog/folds.scm b/runtime/queries/problog/folds.scm
deleted file mode 100644
index 768718207..000000000
--- a/runtime/queries/problog/folds.scm
+++ /dev/null
@@ -1 +0,0 @@
-; inherits: prolog
diff --git a/runtime/queries/problog/highlights.scm b/runtime/queries/problog/highlights.scm
deleted file mode 100644
index de1715662..000000000
--- a/runtime/queries/problog/highlights.scm
+++ /dev/null
@@ -1,4 +0,0 @@
-; inherits: prolog
-
-(probability_label
- _ @attribute)
diff --git a/runtime/queries/problog/indents.scm b/runtime/queries/problog/indents.scm
deleted file mode 100644
index 768718207..000000000
--- a/runtime/queries/problog/indents.scm
+++ /dev/null
@@ -1 +0,0 @@
-; inherits: prolog
diff --git a/runtime/queries/problog/injections.scm b/runtime/queries/problog/injections.scm
deleted file mode 100644
index 768718207..000000000
--- a/runtime/queries/problog/injections.scm
+++ /dev/null
@@ -1 +0,0 @@
-; inherits: prolog
diff --git a/runtime/queries/prolog/folds.scm b/runtime/queries/prolog/folds.scm
deleted file mode 100644
index 70a401511..000000000
--- a/runtime/queries/prolog/folds.scm
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- (directive_term)
- (clause_term)
- (arg_list)
- (list_notation)
-] @fold
diff --git a/runtime/queries/prolog/highlights.scm b/runtime/queries/prolog/highlights.scm
deleted file mode 100644
index fc89b6fef..000000000
--- a/runtime/queries/prolog/highlights.scm
+++ /dev/null
@@ -1,43 +0,0 @@
-(comment) @comment @spell
-
-(atom) @constant
-
-((atom) @boolean
- (#any-of? @boolean "true" "false"))
-
-(functional_notation
- function: (atom) @function.call)
-
-(integer) @number
-
-(float_number) @number.float
-
-(directive_head) @operator
-
-(operator_notation
- operator: _ @operator)
-
-[
- (open)
- (open_ct)
- (close)
- (open_list)
- "|"
- (close_list)
- (open_curly)
- (close_curly)
-] @punctuation.bracket
-
-[
- (arg_list_separator)
- (comma)
- (end)
- (list_notation_separator)
-] @punctuation.delimiter
-
-(operator_notation
- operator: (semicolon) @punctuation.delimiter)
-
-(double_quoted_list_notation) @string
-
-(variable_term) @variable
diff --git a/runtime/queries/prolog/indents.scm b/runtime/queries/prolog/indents.scm
deleted file mode 100644
index a7f9b0383..000000000
--- a/runtime/queries/prolog/indents.scm
+++ /dev/null
@@ -1,16 +0,0 @@
-(directive_term) @indent.zero
-
-(clause_term) @indent.zero
-
-(functional_notation
- (atom)
- (open_ct) @indent.begin
- (close) @indent.end)
-
-(list_notation
- (open_list) @indent.begin
- (close_list) @indent.end)
-
-(curly_bracketed_notation
- (open_curly) @indent.begin
- (close_curly) @indent.end)
diff --git a/runtime/queries/prolog/injections.scm b/runtime/queries/prolog/injections.scm
deleted file mode 100644
index 2f0e58eb6..000000000
--- a/runtime/queries/prolog/injections.scm
+++ /dev/null
@@ -1,2 +0,0 @@
-((comment) @injection.content
- (#set! injection.language "comment"))
diff --git a/runtime/queries/proto/folds.scm b/runtime/queries/proto/folds.scm
index 76f688b7d..87fe6d304 100644
--- a/runtime/queries/proto/folds.scm
+++ b/runtime/queries/proto/folds.scm
@@ -2,6 +2,8 @@
(enum)
(message)
(service)
+ (oneof)
+ (rpc)
] @fold
(import)+ @fold
diff --git a/runtime/queries/proto/highlights.scm b/runtime/queries/proto/highlights.scm
index 894686dd4..22df9002f 100644
--- a/runtime/queries/proto/highlights.scm
+++ b/runtime/queries/proto/highlights.scm
@@ -11,6 +11,9 @@
(field_option
(identifier) @property)
+(enum_value_option
+ (identifier) @property)
+
(block_lit
(identifier) @property)
@@ -21,13 +24,17 @@
"option"
"reserved"
"syntax"
+ "edition"
"to"
+ "max"
] @keyword
[
"enum"
+ "group"
"service"
"message"
+ "map"
] @keyword.type
"rpc" @keyword.function
@@ -35,9 +42,14 @@
"returns" @keyword.return
[
+ "export"
+ "local"
"optional"
"repeated"
"required"
+ "stream"
+ "weak"
+ "public"
] @keyword.modifier
[
@@ -65,6 +77,8 @@
"\"proto2\""
] @string.special
+(escape_sequence) @string.escape
+
(int_lit) @number
(float_lit) @number.float
@@ -97,4 +111,8 @@
":"
] @punctuation.delimiter
-"=" @operator
+[
+ "="
+ "-"
+ "+"
+] @operator
diff --git a/runtime/queries/python/injections.scm b/runtime/queries/python/injections.scm
index 2a120d9b5..28334477c 100644
--- a/runtime/queries/python/injections.scm
+++ b/runtime/queries/python/injections.scm
@@ -3,7 +3,12 @@
object: (identifier) @_re)
arguments: (argument_list
(string
- (string_content) @injection.content))
+ (string_start)
+ [
+ (string_content) @injection.content
+ (interpolation)
+ ]+
+ (string_end)))
(#eq? @_re "re")
(#set! injection.language "regex"))
@@ -12,11 +17,13 @@
object: (identifier) @_re)
arguments: (argument_list
(concatenated_string
- [
- (string
- (string_content) @injection.content)
- (comment)
- ]+))
+ (string
+ (string_start)
+ [
+ (string_content) @injection.content
+ (interpolation)
+ ]+
+ (string_end))))
(#eq? @_re "re")
(#set! injection.language "regex"))
diff --git a/runtime/queries/r/highlights.scm b/runtime/queries/r/highlights.scm
index c849dd838..91ef69bc9 100644
--- a/runtime/queries/r/highlights.scm
+++ b/runtime/queries/r/highlights.scm
@@ -117,7 +117,8 @@ function: (extract_operator
(function_definition
name: "\\" @operator)
-(return) @keyword.return
+((identifier) @keyword.return
+ (#eq? @keyword.return "return"))
[
"if"
diff --git a/runtime/queries/razor/highlights.scm b/runtime/queries/razor/highlights.scm
index 2050bde9c..14c5113cf 100644
--- a/runtime/queries/razor/highlights.scm
+++ b/runtime/queries/razor/highlights.scm
@@ -51,7 +51,10 @@
"at_explicit"
] @variable
-"at_await" @keyword.coroutine
+(razor_implicit_expression
+ "at_implicit" @keyword.coroutine
+ (await_expression
+ "await" @keyword.coroutine))
(razor_rendermode) @property
diff --git a/runtime/queries/rescript/highlights.scm b/runtime/queries/rescript/highlights.scm
index e7cba9be8..c3e002dfd 100644
--- a/runtime/queries/rescript/highlights.scm
+++ b/runtime/queries/rescript/highlights.scm
@@ -1,4 +1,7 @@
-(comment) @comment @spell
+[
+ (line_comment)
+ (block_comment)
+] @comment @spell
; Identifiers
;------------
diff --git a/runtime/queries/rescript/indents.scm b/runtime/queries/rescript/indents.scm
index 0b635dd4d..70bd920a5 100644
--- a/runtime/queries/rescript/indents.scm
+++ b/runtime/queries/rescript/indents.scm
@@ -33,4 +33,7 @@
">"
">" @indent.end)
-(comment) @indent.auto
+[
+ (line_comment)
+ (block_comment)
+] @indent.auto
diff --git a/runtime/queries/rescript/injections.scm b/runtime/queries/rescript/injections.scm
index 434404bef..b40ceb6ae 100644
--- a/runtime/queries/rescript/injections.scm
+++ b/runtime/queries/rescript/injections.scm
@@ -1,4 +1,7 @@
-((comment) @injection.content
+([
+ (line_comment)
+ (block_comment)
+] @injection.content
(#set! injection.language "comment"))
(extension_expression
diff --git a/runtime/queries/robot/highlights.scm b/runtime/queries/robot/highlights.scm
index a9c545b8a..ab30906c7 100644
--- a/runtime/queries/robot/highlights.scm
+++ b/runtime/queries/robot/highlights.scm
@@ -10,7 +10,13 @@
(test_case_setting)
] @keyword
-(variable_definition
+(scalar_variable
+ (variable_name) @variable)
+
+(list_variable
+ (variable_name) @variable)
+
+(dictionary_variable
(variable_name) @variable)
(keyword_definition
diff --git a/runtime/queries/ruby/highlights.scm b/runtime/queries/ruby/highlights.scm
index 0472df092..3116e06b7 100644
--- a/runtime/queries/ruby/highlights.scm
+++ b/runtime/queries/ruby/highlights.scm
@@ -48,6 +48,9 @@
"then"
] @keyword.conditional
+(in_clause
+ "in" @keyword.conditional)
+
(if
"end" @keyword.conditional)
@@ -61,6 +64,9 @@
"next"
] @keyword.repeat
+(in
+ "in" @keyword.repeat)
+
(constant) @constant
((identifier) @keyword.modifier
@@ -219,20 +225,24 @@
(program
(comment)+ @comment.documentation
+ .
(class))
(module
(comment)+ @comment.documentation
+ .
(body_statement
(class)))
(class
(comment)+ @comment.documentation
+ .
(body_statement
(method)))
(body_statement
(comment)+ @comment.documentation
+ .
(method))
; Operators
@@ -291,6 +301,9 @@
(pair
":" @punctuation.delimiter)
+(keyword_pattern
+ ":" @punctuation.delimiter)
+
[
"("
")"
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index de9d09684..2342dcfa3 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -476,9 +476,12 @@
[
(line_comment)
(block_comment)
+] @comment @spell
+
+[
(outer_doc_comment_marker)
(inner_doc_comment_marker)
-] @comment @spell
+] @comment.documentation
(line_comment
(doc_comment)) @comment.documentation
diff --git a/runtime/queries/rust/injections.scm b/runtime/queries/rust/injections.scm
index 7bffd1fc9..b7d5b4bb6 100644
--- a/runtime/queries/rust/injections.scm
+++ b/runtime/queries/rust/injections.scm
@@ -5,7 +5,7 @@
(identifier) @_macro_name
]
(token_tree) @injection.content
- (#not-any-of? @_macro_name "slint" "html" "json")
+ (#not-any-of? @_macro_name "slint" "html" "json" "xml")
(#set! injection.language "rust")
(#set! injection.include-children))
@@ -16,7 +16,7 @@
(identifier) @injection.language
]
(token_tree) @injection.content
- (#any-of? @injection.language "slint" "html" "json")
+ (#any-of? @injection.language "slint" "html" "json" "xml")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children))
diff --git a/runtime/queries/scala/highlights.scm b/runtime/queries/scala/highlights.scm
index 7e623aebc..0c5cf092d 100644
--- a/runtime/queries/scala/highlights.scm
+++ b/runtime/queries/scala/highlights.scm
@@ -183,11 +183,12 @@
"with"
"given"
"using"
- "end"
"implicit"
"extension"
] @keyword
+(end_marker) @keyword
+
[
"enum"
"class"
diff --git a/runtime/queries/scala/indents.scm b/runtime/queries/scala/indents.scm
new file mode 100644
index 000000000..e40d6f487
--- /dev/null
+++ b/runtime/queries/scala/indents.scm
@@ -0,0 +1,32 @@
+[
+ (template_body)
+ (block)
+ (parameters)
+ (arguments)
+ (match_expression)
+ (splice_expression)
+ (import_declaration)
+ (function_definition)
+ "match"
+ ":"
+ "="
+] @indent.begin
+
+(ERROR
+ ":") @indent.begin
+
+(ERROR
+ "=") @indent.begin
+
+(arguments
+ ")" @indent.end)
+
+"}" @indent.end
+
+(end_marker) @indent.end
+
+[
+ ")"
+ "]"
+ "}"
+] @indent.branch
diff --git a/runtime/queries/supercollider/folds.scm b/runtime/queries/supercollider/folds.scm
index 2f5f1043a..a62272b5c 100644
--- a/runtime/queries/supercollider/folds.scm
+++ b/runtime/queries/supercollider/folds.scm
@@ -2,5 +2,4 @@
(function_call)
(code_block)
(function_block)
- (control_structure)
] @fold
diff --git a/runtime/queries/supercollider/highlights.scm b/runtime/queries/supercollider/highlights.scm
index c56bce69a..bef85ef45 100644
--- a/runtime/queries/supercollider/highlights.scm
+++ b/runtime/queries/supercollider/highlights.scm
@@ -1,6 +1,6 @@
; highlights.scm
; See this for full list: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md
-; comments
+; Comments
(line_comment) @comment @spell
(block_comment) @comment @spell
@@ -9,6 +9,12 @@
(argument
name: (identifier) @variable.parameter)
+"..." @variable.parameter ; variable argument
+
+; For function calls
+(named_argument
+ name: (identifier) @variable.parameter)
+
; Variables
(local_var
name: (identifier) @variable)
@@ -18,31 +24,58 @@
(builtin_var) @constant.builtin
-; (variable) @variable
; Functions
(function_definition
name: (variable) @function)
-; For function calls
-(named_argument
- name: (identifier) @function.call)
-
; Methods
-(method_call
- name: (method_name) @function.method.call)
+(function_call
+ name: (_) @function.method.call)
+
+; Collections
+(associative_item
+ (identifier) @property)
; Classes
(class) @type
+(parent_class) @type
+
+(instance_method_name) @function.method
+
+(class_method_name) @function.method
+
; Literals
+(bool) @boolean
+
(number) @number
(float) @number.float
(string) @string
+(escape_sequence) @string.escape
+
(symbol) @string.special.symbol
+; Conditionals
+[
+ "?"
+ "!?"
+ "??"
+] @keyword.conditional
+
+((function_call
+ name: (_) @keyword.conditional)
+ (#any-of? @keyword.conditional "if" "while" "case" "switch" "try" "protect"))
+
+((function_call
+ name: (_) @keyword.repeat)
+ (#any-of? @keyword.repeat "for" "forBy"))
+
+; Duplication operator
+"!" @keyword.repeat
+
; Operators
[
"&&"
@@ -52,6 +85,8 @@
"^"
"=="
"!="
+ "==="
+ "!=="
"<"
"<="
">"
@@ -64,6 +99,13 @@
"/"
"%"
"="
+ "@"
+ "|@|"
+ "@@"
+ "@|@"
+ "++"
+ "+/+"
+ ".."
] @operator
; Keywords
@@ -71,11 +113,13 @@
"arg"
"classvar"
"const"
- ; "super"
- ; "this"
"var"
] @keyword
+((local_var
+ name: (identifier) @variable.builtin)
+ (#any-of? @variable.builtin "this" "super"))
+
; Brackets
[
"("
@@ -92,12 +136,5 @@
";"
"."
","
+ ":"
] @punctuation.delimiter
-
-; control structure
-(control_structure) @keyword.conditional
-
-(escape_sequence) @string.escape
-
-; SinOsc.ar()!2
-(duplicated_statement) @keyword.repeat
diff --git a/runtime/queries/supercollider/indents.scm b/runtime/queries/supercollider/indents.scm
index c0cffab3c..396721abf 100644
--- a/runtime/queries/supercollider/indents.scm
+++ b/runtime/queries/supercollider/indents.scm
@@ -12,21 +12,30 @@
(variable_definition)
(variable_definition_sequence
(variable_definition))
- (control_structure)
(return_statement)
] @indent.begin
[
(parameter_call_list
- (argument_calls))
- "("
+ (_))
")"
- "{"
"}"
- "["
"]"
] @indent.branch
+; for auto-indent while typing
+(ERROR
+ "{") @indent.begin
+
+(ERROR
+ "}") @indent.branch
+
+(ERROR
+ "[") @indent.begin
+
+(ERROR
+ "]") @indent.branch
+
[
(block_comment)
(line_comment)
diff --git a/runtime/queries/supercollider/locals.scm b/runtime/queries/supercollider/locals.scm
index 066bbf9ab..b0a082131 100644
--- a/runtime/queries/supercollider/locals.scm
+++ b/runtime/queries/supercollider/locals.scm
@@ -3,7 +3,6 @@
(function_call)
(code_block)
(function_block)
- (control_structure)
] @local.scope
; Definitions
diff --git a/runtime/queries/swift/highlights.scm b/runtime/queries/swift/highlights.scm
index b911183d1..949772003 100644
--- a/runtime/queries/swift/highlights.scm
+++ b/runtime/queries/swift/highlights.scm
@@ -281,7 +281,7 @@
(boolean_literal) @boolean
-"nil" @constant.builtin
+(nil_literal) @constant.builtin
(wildcard_pattern) @character.special
diff --git a/runtime/queries/textproto/highlights.scm b/runtime/queries/textproto/highlights.scm
index 527af0398..f4d355ce2 100644
--- a/runtime/queries/textproto/highlights.scm
+++ b/runtime/queries/textproto/highlights.scm
@@ -6,6 +6,18 @@
(number) @number
+"-" @operator
+
+[
+ ":"
+ ";"
+ ","
+ "."
+ "/"
+] @punctuation.delimiter
+
+(string_escape) @string.escape
+
; For stuff like "inf" and "-inf".
(scalar_value
[
diff --git a/runtime/queries/tmux/highlights.scm b/runtime/queries/tmux/highlights.scm
deleted file mode 100644
index 33509d76e..000000000
--- a/runtime/queries/tmux/highlights.scm
+++ /dev/null
@@ -1,65 +0,0 @@
-(comment) @comment @spell
-
-[
- "'"
- (str_single_quotes)
- (str_double_quotes)
-] @string
-
-(backslash_escape) @string.escape
-
-(path) @string.special.path
-
-(int) @number
-
-[
- (option)
- (name)
-] @variable
-
-(command_line_option) @variable.builtin
-
-((option) @variable.builtin
- (#not-lua-match? @variable.builtin "^@"))
-
-[
- (if_keyword)
- (elif_keyword)
- (else_keyword)
- (endif_keyword)
-] @keyword.conditional
-
-[
- (hidden_keyword)
- (command)
-] @keyword
-
-(source_file_directive
- (command) @keyword.import)
-
-(attribute) @attribute
-
-(function_name) @function.call
-
-"=" @operator
-
-[
- ";"
- "';'"
- ","
- ":"
-] @punctuation.delimiter
-
-[
- "#"
- "?"
-] @punctuation.special
-
-[
- "#{"
- "}"
- "#["
- "]"
- "["
- "{"
-] @punctuation.bracket
diff --git a/runtime/queries/tmux/injections.scm b/runtime/queries/tmux/injections.scm
deleted file mode 100644
index 5bf6e27d2..000000000
--- a/runtime/queries/tmux/injections.scm
+++ /dev/null
@@ -1,5 +0,0 @@
-((shell) @injection.content
- (#set! injection.language "bash"))
-
-((comment) @injection.content
- (#set! injection.language "comment"))
diff --git a/runtime/queries/typst/highlights.scm b/runtime/queries/typst/highlights.scm
index a0dcc1b89..0ae538fe1 100644
--- a/runtime/queries/typst/highlights.scm
+++ b/runtime/queries/typst/highlights.scm
@@ -106,7 +106,17 @@
(emph) @markup.italic
-(url) @markup.link.url
+((url) @markup.link.url
+ (#set! @markup.link.url url @markup.link.url))
+
+(call
+ item: (ident) @_link
+ (#eq? @_link "link")
+ (group
+ .
+ (string) @markup.link.url
+ (#offset! @markup.link.url 0 1 0 -1)
+ (#set! @markup.link.url url @markup.link.url)))
; code blocks
(raw_span) @markup.raw
diff --git a/runtime/queries/typst/indents.scm b/runtime/queries/typst/indents.scm
index d43c586c1..424320fe4 100644
--- a/runtime/queries/typst/indents.scm
+++ b/runtime/queries/typst/indents.scm
@@ -3,10 +3,12 @@
(let)
(show)
(call)
+ (for)
+ (branch)
] @indent.begin
[
"]"
"}"
")"
-] @indent.branch @indent.end
+] @indent.end @indent.branch
diff --git a/runtime/queries/usd/highlights.scm b/runtime/queries/usd/highlights.scm
index d6c2a3668..98a7ff95c 100644
--- a/runtime/queries/usd/highlights.scm
+++ b/runtime/queries/usd/highlights.scm
@@ -52,12 +52,14 @@
"]"
"{"
"}"
+ "[]"
] @punctuation.bracket
[
":"
";"
"."
+ ","
] @punctuation.delimiter
"=" @operator
diff --git a/runtime/queries/vento/highlights.scm b/runtime/queries/vento/highlights.scm
index 9d35b2f66..ec31aae20 100644
--- a/runtime/queries/vento/highlights.scm
+++ b/runtime/queries/vento/highlights.scm
@@ -1,6 +1,26 @@
(comment) @comment @spell
-(keyword) @keyword
+[
+ "if"
+ "/if"
+ "else"
+ "for"
+ "/for"
+ "layout"
+ "/layout"
+ "set"
+ "/set"
+ "import"
+ "export"
+ "/export"
+ "include"
+ "function"
+ "/function"
+ "fragment"
+ "/fragment"
+ "of"
+ "async"
+] @keyword
(tag
[
diff --git a/runtime/queries/wit/highlights.scm b/runtime/queries/wit/highlights.scm
index d950f9549..fd6ffcd5d 100644
--- a/runtime/queries/wit/highlights.scm
+++ b/runtime/queries/wit/highlights.scm
@@ -1,7 +1,7 @@
(ty
(id)) @type
-(package_decl
+(decl_head
(id) @module)
(version) @string.special
@@ -12,7 +12,7 @@
"/"
] @punctuation.delimiter)
-(package_decl
+(decl_head
[
"@"
"/"
@@ -121,6 +121,11 @@
"func" @keyword.function
+(external_id
+ "@" @punctuation.special
+ "external-id" @attribute.builtin
+ id: (string_literal) @string)
+
[
"type"
"interface"
@@ -168,6 +173,7 @@
"list"
"option"
"result"
+ "map"
"borrow"
"future"
"stream"
diff --git a/runtime/queries/yuck/indents.scm b/runtime/queries/yuck/indents.scm
index 515795021..806516bea 100644
--- a/runtime/queries/yuck/indents.scm
+++ b/runtime/queries/yuck/indents.scm
@@ -1,7 +1,5 @@
[
(ast_block)
- (array)
- (expr)
(json_array)
(json_object)
(parenthesized_expression)
diff --git a/runtime/queries/yuck/locals.scm b/runtime/queries/yuck/locals.scm
index 9f40b2082..6c23fec38 100644
--- a/runtime/queries/yuck/locals.scm
+++ b/runtime/queries/yuck/locals.scm
@@ -1,8 +1,5 @@
[
(ast_block)
- (list)
- (array)
- (expr)
(json_array)
(json_object)
(parenthesized_expression)
@@ -16,6 +13,4 @@
(simplexpr
(ident) @local.definition.field))
-(ast_block
- (symbol)
- (ident) @local.definition.type)
+(symbol) @local.definition.type
diff --git a/runtime/queries/zathurarc/highlights.scm b/runtime/queries/zathurarc/highlights.scm
deleted file mode 100644
index 04daa190a..000000000
--- a/runtime/queries/zathurarc/highlights.scm
+++ /dev/null
@@ -1,36 +0,0 @@
-; General
-(path) @string.special.path
-
-(option) @variable.builtin
-
-(command) @keyword
-
-(include_directive
- (command) @keyword.import)
-
-(mode_name) @type.builtin
-
-(key) @constant
-
-(function) @function.call
-
-(argument) @variable.parameter
-
-; Comments
-(comment) @comment @spell
-
-; Literals
-(int) @number
-
-(float) @number.float
-
-(string) @string
-
-(bool) @boolean
-
-[
- "<"
- ">"
- "["
- "]"
-] @punctuation.bracket
diff --git a/runtime/queries/zathurarc/injections.scm b/runtime/queries/zathurarc/injections.scm
deleted file mode 100644
index 8e45396b7..000000000
--- a/runtime/queries/zathurarc/injections.scm
+++ /dev/null
@@ -1,9 +0,0 @@
-(set_directive
- (option) @_option
- (string) @injection.content
- (#eq? @_option "synctex-editor-command")
- (#offset! @injection.content 0 1 0 -1)
- (#set! injection.language "bash"))
-
-((comment) @injection.content
- (#set! injection.language "comment"))
diff --git a/runtime/queries/zsh/highlights.scm b/runtime/queries/zsh/highlights.scm
index 75a37408b..20fac01ba 100644
--- a/runtime/queries/zsh/highlights.scm
+++ b/runtime/queries/zsh/highlights.scm
@@ -14,8 +14,8 @@
[
";"
";;"
- ";&"
- ";;&"
+ (case_fallthrough)
+ (case_test_next)
"&"
] @punctuation.delimiter