aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries
diff options
context:
space:
mode:
authorGokul Soumya2022-01-06 05:56:35 +0000
committerGokul Soumya2022-01-06 06:02:03 +0000
commit449624965b05fd2abc9e3ba2f791f8de8b1eeb3e (patch)
treecbe060df6a61330e6a470c521ed254f5c7dc4f4f /runtime/queries
parentc0bbadcaaf42698d102fa03f6f9267021f3efec0 (diff)
parent2e02a1d6bc004212033b9c4e5ed0de0fd880796c (diff)
Merge branch 'master' into cursor-shape-new
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/c/indents.toml16
-rw-r--r--runtime/queries/c/injections.scm2
-rw-r--r--runtime/queries/c/textobjects.scm13
-rw-r--r--runtime/queries/cmake/indents.toml12
-rw-r--r--runtime/queries/cmake/injections.scm4
-rw-r--r--runtime/queries/cmake/textobjects.scm3
-rw-r--r--runtime/queries/comment/highlights.scm30
-rw-r--r--runtime/queries/cpp/indents.toml17
-rw-r--r--runtime/queries/cpp/injections.scm1
-rw-r--r--runtime/queries/cpp/textobjects.scm7
-rw-r--r--runtime/queries/dart/highlights.scm237
-rw-r--r--runtime/queries/dart/indents.toml20
-rw-r--r--runtime/queries/dart/locals.scm20
-rw-r--r--runtime/queries/dockerfile/highlights.scm51
-rw-r--r--runtime/queries/dockerfile/injections.scm6
-rw-r--r--runtime/queries/elixir/injections.scm2
-rw-r--r--runtime/queries/fish/highlights.scm156
-rw-r--r--runtime/queries/fish/indents.toml12
-rw-r--r--runtime/queries/fish/injections.scm2
-rw-r--r--runtime/queries/fish/textobjects.scm1
-rw-r--r--runtime/queries/git-commit/highlights.scm14
-rw-r--r--runtime/queries/git-commit/injections.scm8
-rw-r--r--runtime/queries/git-diff/highlights.scm6
-rw-r--r--runtime/queries/git-rebase/highlights.scm11
-rw-r--r--runtime/queries/git-rebase/injections.scm4
-rw-r--r--runtime/queries/glsl/injections.scm5
-rw-r--r--runtime/queries/julia/injections.scm8
-rw-r--r--runtime/queries/latex/highlights.scm2
-rw-r--r--runtime/queries/ledger/injections.scm4
-rw-r--r--runtime/queries/llvm-mir-yaml/highlights.scm1
-rw-r--r--runtime/queries/llvm-mir-yaml/indents.toml3
-rw-r--r--runtime/queries/llvm-mir-yaml/injections.scm9
-rw-r--r--runtime/queries/llvm-mir/highlights.scm136
-rw-r--r--runtime/queries/llvm-mir/indents.toml7
-rw-r--r--runtime/queries/llvm-mir/injections.scm2
-rw-r--r--runtime/queries/llvm-mir/textobjects.scm3
-rw-r--r--runtime/queries/llvm/highlights.scm162
-rw-r--r--runtime/queries/llvm/indents.toml8
-rw-r--r--runtime/queries/llvm/injections.scm2
-rw-r--r--runtime/queries/llvm/locals.scm14
-rw-r--r--runtime/queries/llvm/textobjects.scm16
-rw-r--r--runtime/queries/markdown/highlights.scm7
-rw-r--r--runtime/queries/markdown/injections.scm3
-rw-r--r--runtime/queries/nix/highlights.scm7
-rw-r--r--runtime/queries/ocaml/indents.toml2
-rw-r--r--runtime/queries/python/injections.scm2
-rw-r--r--runtime/queries/ruby/indents.toml25
-rw-r--r--runtime/queries/rust/highlights.scm14
-rw-r--r--runtime/queries/rust/indents.toml1
-rw-r--r--runtime/queries/rust/injections.scm3
-rw-r--r--runtime/queries/scala/highlights.scm203
-rw-r--r--runtime/queries/scala/indents.toml23
-rw-r--r--runtime/queries/scala/injections.scm1
-rw-r--r--runtime/queries/svelte/highlights.scm4
-rw-r--r--runtime/queries/svelte/injections.scm4
-rw-r--r--runtime/queries/tablegen/highlights.scm90
-rw-r--r--runtime/queries/tablegen/indents.toml7
-rw-r--r--runtime/queries/tablegen/injections.scm2
-rw-r--r--runtime/queries/tablegen/textobjects.scm7
-rw-r--r--runtime/queries/tsq/injections.scm2
-rw-r--r--runtime/queries/yaml/highlights.scm16
-rw-r--r--runtime/queries/yaml/injections.scm2
62 files changed, 1427 insertions, 35 deletions
diff --git a/runtime/queries/c/indents.toml b/runtime/queries/c/indents.toml
new file mode 100644
index 00000000..f4076e17
--- /dev/null
+++ b/runtime/queries/c/indents.toml
@@ -0,0 +1,16 @@
+indent = [
+ "compound_statement",
+ "field_declaration_list",
+ "enumerator_list",
+ "parameter_list",
+ "init_declarator",
+ "case_statement",
+ "condition_clause",
+ "expression_statement",
+]
+
+outdent = [
+ "case",
+ "}",
+ "]",
+]
diff --git a/runtime/queries/c/injections.scm b/runtime/queries/c/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/c/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/c/textobjects.scm b/runtime/queries/c/textobjects.scm
new file mode 100644
index 00000000..b0f03668
--- /dev/null
+++ b/runtime/queries/c/textobjects.scm
@@ -0,0 +1,13 @@
+(function_definition
+ body: (_) @function.inside) @function.around
+
+(struct_specifier
+ body: (_) @class.inside) @class.around
+
+(enum_specifier
+ body: (_) @class.inside) @class.around
+
+(union_specifier
+ body: (_) @class.inside) @class.around
+
+(parameter_declaration) @parameter.inside
diff --git a/runtime/queries/cmake/indents.toml b/runtime/queries/cmake/indents.toml
new file mode 100644
index 00000000..8b886a4f
--- /dev/null
+++ b/runtime/queries/cmake/indents.toml
@@ -0,0 +1,12 @@
+indent = [
+ "if_condition",
+ "foreach_loop",
+ "while_loop",
+ "function_def",
+ "macro_def",
+ "normal_command",
+]
+
+outdent = [
+ ")"
+]
diff --git a/runtime/queries/cmake/injections.scm b/runtime/queries/cmake/injections.scm
new file mode 100644
index 00000000..6cb6c254
--- /dev/null
+++ b/runtime/queries/cmake/injections.scm
@@ -0,0 +1,4 @@
+((line_comment) @injection.content
+ (#set! injection.language "comment"))
+((bracket_comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/cmake/textobjects.scm b/runtime/queries/cmake/textobjects.scm
new file mode 100644
index 00000000..b0d1b108
--- /dev/null
+++ b/runtime/queries/cmake/textobjects.scm
@@ -0,0 +1,3 @@
+(macro_def) @function.around
+
+(argument) @parameter.inside
diff --git a/runtime/queries/comment/highlights.scm b/runtime/queries/comment/highlights.scm
new file mode 100644
index 00000000..88685d59
--- /dev/null
+++ b/runtime/queries/comment/highlights.scm
@@ -0,0 +1,30 @@
+[
+ "("
+ ")"
+] @punctuation.bracket
+
+":" @punctuation.delimiter
+
+((tag (name) @warning)
+ (#match? @warning "^(TODO|HACK|WARNING)$"))
+
+("text" @warning
+ (#match? @warning "^(TODO|HACK|WARNING)$"))
+
+((tag (name) @error)
+ (match? @error "^(FIXME|XXX|BUG)$"))
+
+("text" @error
+ (match? @error "^(FIXME|XXX|BUG)$"))
+
+(tag
+ (name) @ui.text
+ (user)? @constant)
+
+; Issue number (#123)
+("text" @constant.numeric
+ (#match? @constant.numeric "^#[0-9]+$"))
+
+; User mention (@user)
+("text" @tag
+ (#match? @tag "^[@][a-zA-Z0-9_-]+$"))
diff --git a/runtime/queries/cpp/indents.toml b/runtime/queries/cpp/indents.toml
new file mode 100644
index 00000000..0ca2ed8b
--- /dev/null
+++ b/runtime/queries/cpp/indents.toml
@@ -0,0 +1,17 @@
+indent = [
+ "compound_statement",
+ "field_declaration_list",
+ "enumerator_list",
+ "parameter_list",
+ "init_declarator",
+ "case_statement",
+ "condition_clause",
+ "expression_statement",
+]
+
+outdent = [
+ "case",
+ "access_specifier",
+ "}",
+ "]",
+]
diff --git a/runtime/queries/cpp/injections.scm b/runtime/queries/cpp/injections.scm
new file mode 100644
index 00000000..a5a5208c
--- /dev/null
+++ b/runtime/queries/cpp/injections.scm
@@ -0,0 +1 @@
+; inherits: c
diff --git a/runtime/queries/cpp/textobjects.scm b/runtime/queries/cpp/textobjects.scm
new file mode 100644
index 00000000..6e3de1a2
--- /dev/null
+++ b/runtime/queries/cpp/textobjects.scm
@@ -0,0 +1,7 @@
+; inherits: c
+
+(lambda_expression
+ body: (_) @function.inside) @function.around
+
+(class_specifier
+ body: (_) @class.inside) @class.around
diff --git a/runtime/queries/dart/highlights.scm b/runtime/queries/dart/highlights.scm
new file mode 100644
index 00000000..9f667d6b
--- /dev/null
+++ b/runtime/queries/dart/highlights.scm
@@ -0,0 +1,237 @@
+(dotted_identifier_list) @string
+
+; Methods
+; --------------------
+(super) @function.builtin
+
+(function_expression_body (identifier) @function.method)
+((identifier)(selector (argument_part)) @function.method)
+
+; Annotations
+; --------------------
+(annotation
+ name: (identifier) @attribute)
+(marker_annotation
+ name: (identifier) @attribute)
+
+; Types
+; --------------------
+(class_definition
+ name: (identifier) @type)
+
+(constructor_signature
+ name: (identifier) @function.method)
+
+(function_signature
+ name: (identifier) @function.method)
+
+(getter_signature
+ (identifier) @function.builtin)
+
+(setter_signature
+ name: (identifier) @function.builtin)
+
+(enum_declaration
+ name: (identifier) @type)
+
+(enum_constant
+ name: (identifier) @type.builtin)
+
+(void_type) @type.builtin
+
+((scoped_identifier
+ scope: (identifier) @type)
+ (#match? @type "^[a-zA-Z]"))
+
+((scoped_identifier
+ scope: (identifier) @type
+ name: (identifier) @type)
+ (#match? @type "^[a-zA-Z]"))
+
+; the DisabledDrawerButtons in : const DisabledDrawerButtons(history: true),
+(type_identifier) @type.builtin
+
+; Variables
+; --------------------
+; the "File" in var file = File();
+((identifier) @namespace
+ (#match? @namespace "^_?[A-Z].*[a-z]")) ; catch Classes or IClasses not CLASSES
+
+("Function" @type.builtin)
+(inferred_type) @type.builtin
+
+; properties
+(unconditional_assignable_selector
+ (identifier) @variable.other.member)
+
+(conditional_assignable_selector
+ (identifier) @variable.other.member)
+
+; assignments
+; --------------------
+; the "strings" in : strings = "some string"
+(assignment_expression
+ left: (assignable_expression) @variable)
+
+(this) @variable.builtin
+
+; Parameters
+; --------------------
+(formal_parameter
+ name: (identifier) @variable)
+
+(named_argument
+ (label (identifier) @variable))
+
+; Literals
+; --------------------
+[
+ (hex_integer_literal)
+ (decimal_integer_literal)
+ (decimal_floating_point_literal)
+ ;(octal_integer_literal)
+ ;(hex_floating_point_literal)
+] @constant.numeric.integer
+
+(symbol_literal) @string.special.symbol
+(string_literal) @string
+
+[
+ (const_builtin)
+ (final_builtin)
+] @variable.builtin
+
+[
+ (true)
+ (false)
+] @constant.builtin.boolean
+
+(null_literal) @constant.builtin
+
+(comment) @comment.line
+(documentation_comment) @comment.block.documentation
+
+; Tokens
+; --------------------
+(template_substitution
+ "$" @punctuation.special
+ "{" @punctuation.special
+ "}" @punctuation.special
+) @embedded
+
+(template_substitution
+ "$" @punctuation.special
+ (identifier_dollar_escaped) @variable
+) @embedded
+
+(escape_sequence) @constant.character.escape
+
+; Punctuation
+;---------------------
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ";"
+ "."
+ ","
+ ":"
+] @punctuation.delimiter
+
+; Operators
+;---------------------
+[
+ "@"
+ "?"
+ "=>"
+ ".."
+ "=="
+ "&&"
+ "%"
+ "<"
+ ">"
+ "="
+ ">="
+ "<="
+ "||"
+ (multiplicative_operator)
+ (increment_operator)
+ (is_operator)
+ (prefix_operator)
+ (equality_operator)
+ (additive_operator)
+] @operator
+
+; Keywords
+; --------------------
+["import" "library" "export"] @keyword.control.import
+["do" "while" "continue" "for"] @keyword.control.repeat
+["return" "yield"] @keyword.control.return
+["as" "in" "is"] @keyword.operator
+
+[
+ "?."
+ "??"
+ "if"
+ "else"
+ "switch"
+ "default"
+ "late"
+] @keyword.control.conditional
+
+[
+ "try"
+ "throw"
+ "catch"
+ "finally"
+ (break_statement)
+] @keyword.control.exception
+
+; Reserved words (cannot be used as identifiers)
+[
+ (case_builtin)
+ "abstract"
+ "async"
+ "async*"
+ "await"
+ "class"
+ "covariant"
+ "deferred"
+ "dynamic"
+ "enum"
+ "extends"
+ "extension"
+ "external"
+ "factory"
+ "Function"
+ "get"
+ "implements"
+ "interface"
+ "mixin"
+ "new"
+ "on"
+ "operator"
+ "part"
+ "required"
+ "set"
+ "show"
+ "static"
+ "super"
+ "sync*"
+ "typedef"
+ "with"
+] @keyword
+
+; when used as an identifier:
+((identifier) @variable.builtin
+ (#match? @variable.builtin "^(abstract|as|covariant|deferred|dynamic|export|external|factory|Function|get|implements|import|interface|library|operator|mixin|part|set|static|typedef)$"))
+
+; Error
+(ERROR) @error
+
diff --git a/runtime/queries/dart/indents.toml b/runtime/queries/dart/indents.toml
new file mode 100644
index 00000000..5c11e05d
--- /dev/null
+++ b/runtime/queries/dart/indents.toml
@@ -0,0 +1,20 @@
+indent = [
+ "class_body",
+ "function_body",
+ "function_expression_body",
+ "declaration",
+ "initializers",
+ "switch_block",
+ "if_statement",
+ "formal_parameter_list",
+ "formal_parameter",
+ "list_literal",
+ "return_statement",
+ "arguments"
+]
+
+outdent = [
+ "}",
+ "]",
+ ")"
+]
diff --git a/runtime/queries/dart/locals.scm b/runtime/queries/dart/locals.scm
new file mode 100644
index 00000000..629838e5
--- /dev/null
+++ b/runtime/queries/dart/locals.scm
@@ -0,0 +1,20 @@
+; Scopes
+;-------
+
+[
+ (block)
+ (try_statement)
+ (catch_clause)
+ (finally_clause)
+] @local.scope
+
+; Definitions
+;------------
+
+(class_definition
+ body: (_) @local.definition)
+
+; References
+;------------
+
+(identifier) @local.reference
diff --git a/runtime/queries/dockerfile/highlights.scm b/runtime/queries/dockerfile/highlights.scm
new file mode 100644
index 00000000..5a945fb9
--- /dev/null
+++ b/runtime/queries/dockerfile/highlights.scm
@@ -0,0 +1,51 @@
+[
+ "FROM"
+ "AS"
+ "RUN"
+ "CMD"
+ "LABEL"
+ "EXPOSE"
+ "ENV"
+ "ADD"
+ "COPY"
+ "ENTRYPOINT"
+ "VOLUME"
+ "USER"
+ "WORKDIR"
+ "ARG"
+ "ONBUILD"
+ "STOPSIGNAL"
+ "HEALTHCHECK"
+ "SHELL"
+ "MAINTAINER"
+ "CROSS_BUILD"
+] @keyword
+
+[
+ ":"
+ "@"
+] @operator
+
+(comment) @comment
+
+
+(image_spec
+ (image_tag
+ ":" @punctuation.special)
+ (image_digest
+ "@" @punctuation.special))
+
+(double_quoted_string) @string
+
+(expansion
+ [
+ "$"
+ "{"
+ "}"
+ ] @punctuation.special
+) @none
+
+((variable) @constant
+ (#match? @constant "^[A-Z][A-Z_0-9]*$"))
+
+
diff --git a/runtime/queries/dockerfile/injections.scm b/runtime/queries/dockerfile/injections.scm
new file mode 100644
index 00000000..20396f1a
--- /dev/null
+++ b/runtime/queries/dockerfile/injections.scm
@@ -0,0 +1,6 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
+
+([(shell_command) (shell_fragment)] @injection.content
+ (#set! injection.language "bash"))
+
diff --git a/runtime/queries/elixir/injections.scm b/runtime/queries/elixir/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/elixir/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm
new file mode 100644
index 00000000..def53931
--- /dev/null
+++ b/runtime/queries/fish/highlights.scm
@@ -0,0 +1,156 @@
+;; Operators
+
+[
+ "&&"
+ "||"
+ "|"
+ "&"
+ "="
+ "!="
+ ".."
+ "!"
+ (direction)
+ (stream_redirect)
+ (test_option)
+] @operator
+
+[
+ "not"
+ "and"
+ "or"
+] @keyword.operator
+
+;; Conditionals
+
+(if_statement
+[
+ "if"
+ "end"
+] @keyword.control.conditional)
+
+(switch_statement
+[
+ "switch"
+ "end"
+] @keyword.control.conditional)
+
+(case_clause
+[
+ "case"
+] @keyword.control.conditional)
+
+(else_clause
+[
+ "else"
+] @keyword.control.conditional)
+
+(else_if_clause
+[
+ "else"
+ "if"
+] @keyword.control.conditional)
+
+;; Loops/Blocks
+
+(while_statement
+[
+ "while"
+ "end"
+] @keyword.control.repeat)
+
+(for_statement
+[
+ "for"
+ "end"
+] @keyword.control.repeat)
+
+(begin_statement
+[
+ "begin"
+ "end"
+] @keyword.control.repeat)
+
+;; Keywords
+
+[
+ "in"
+ (break)
+ (continue)
+] @keyword
+
+"return" @keyword.control.return
+
+;; Punctuation
+
+[
+ "["
+ "]"
+ "{"
+ "}"
+ "("
+ ")"
+] @punctuation.bracket
+
+"," @punctuation.delimiter
+
+;; Commands
+
+(command
+ argument: [
+ (word) @variable.parameter (#match? @variable.parameter "^-")
+ ]
+)
+
+; non-bultin command names
+(command name: (word) @function)
+
+; derived from builtin -n (fish 3.2.2)
+(command
+ name: [
+ (word) @function.builtin
+ (#match? @function.builtin "^(\.|:|_|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|printf|pwd|random|read|realpath|set|set_color|source|status|string|test|time|type|ulimit|wait)$")
+ ]
+)
+
+(test_command "test" @function.builtin)
+
+;; Functions
+
+(function_definition ["function" "end"] @keyword.function)
+
+(function_definition
+ name: [
+ (word) (concatenation)
+ ]
+@function)
+
+(function_definition
+ option: [
+ (word)
+ (concatenation (word))
+ ] @variable.parameter (#match? @variable.parameter "^-")
+)
+
+;; Strings
+
+[(double_quote_string) (single_quote_string)] @string
+(escape_sequence) @constant.character.escape
+
+;; Variables
+
+(variable_name) @variable
+(variable_expansion) @constant
+
+;; Nodes
+
+(integer) @constant.numeric.integer
+(float) @constant.numeric.float
+(comment) @comment
+(test_option) @string
+
+((word) @constant.builtin.boolean
+(#match? @constant.builtin.boolean "^(true|false)$"))
+
+;; Error
+
+(ERROR) @error
diff --git a/runtime/queries/fish/indents.toml b/runtime/queries/fish/indents.toml
new file mode 100644
index 00000000..6f1e563a
--- /dev/null
+++ b/runtime/queries/fish/indents.toml
@@ -0,0 +1,12 @@
+indent = [
+ "function_definition",
+ "while_statement",
+ "for_statement",
+ "if_statement",
+ "begin_statement",
+ "switch_statement",
+]
+
+outdent = [
+ "end"
+]
diff --git a/runtime/queries/fish/injections.scm b/runtime/queries/fish/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/fish/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/fish/textobjects.scm b/runtime/queries/fish/textobjects.scm
new file mode 100644
index 00000000..67fd6614
--- /dev/null
+++ b/runtime/queries/fish/textobjects.scm
@@ -0,0 +1 @@
+(function_definition) @function.around
diff --git a/runtime/queries/git-commit/highlights.scm b/runtime/queries/git-commit/highlights.scm
new file mode 100644
index 00000000..0b50d419
--- /dev/null
+++ b/runtime/queries/git-commit/highlights.scm
@@ -0,0 +1,14 @@
+(subject) @markup.heading
+(path) @string.special.path
+(branch) @string.special.symbol
+(commit) @constant
+(item) @markup.link.url
+(header) @tag
+
+(change kind: "new file" @diff.plus)
+(change kind: "deleted" @diff.minus)
+(change kind: "modified" @diff.delta)
+(change kind: "renamed" @diff.delta.moved)
+
+[":" "->"] @punctuation.delimeter
+(comment) @comment
diff --git a/runtime/queries/git-commit/injections.scm b/runtime/queries/git-commit/injections.scm
new file mode 100644
index 00000000..cf0657f7
--- /dev/null
+++ b/runtime/queries/git-commit/injections.scm
@@ -0,0 +1,8 @@
+((comment (scissors))
+ (message) @injection.content
+ (#set! injection.include-children)
+ (#set! injection.language "diff"))
+
+((rebase_command) @injection.content
+ (#set! injection.include-children)
+ (#set! injection.language "git-rebase"))
diff --git a/runtime/queries/git-diff/highlights.scm b/runtime/queries/git-diff/highlights.scm
new file mode 100644
index 00000000..1c1a8829
--- /dev/null
+++ b/runtime/queries/git-diff/highlights.scm
@@ -0,0 +1,6 @@
+[(addition) (new_file)] @diff.plus
+[(deletion) (old_file)] @diff.minus
+
+(commit) @constant
+(location) @attribute
+(command) @markup.bold
diff --git a/runtime/queries/git-rebase/highlights.scm b/runtime/queries/git-rebase/highlights.scm
new file mode 100644
index 00000000..4f007037
--- /dev/null
+++ b/runtime/queries/git-rebase/highlights.scm
@@ -0,0 +1,11 @@
+(operation operator: ["p" "pick" "r" "reword" "e" "edit" "s" "squash" "m" "merge" "d" "drop" "b" "break" "x" "exec"] @keyword)
+(operation operator: ["l" "label" "t" "reset"] @function)
+(operation operator: ["f" "fixup"] @function.special)
+
+(option) @operator
+(label) @string.special.symbol
+(commit) @constant
+"#" @punctuation.delimiter
+(comment) @comment
+
+(ERROR) @error
diff --git a/runtime/queries/git-rebase/injections.scm b/runtime/queries/git-rebase/injections.scm
new file mode 100644
index 00000000..070129b6
--- /dev/null
+++ b/runtime/queries/git-rebase/injections.scm
@@ -0,0 +1,4 @@
+((operation
+ operator: ["x" "exec"]
+ (command) @injection.content)
+ (#set! injection.language "bash"))
diff --git a/runtime/queries/glsl/injections.scm b/runtime/queries/glsl/injections.scm
index 7d3323b1..6330ea3e 100644
--- a/runtime/queries/glsl/injections.scm
+++ b/runtime/queries/glsl/injections.scm
@@ -1,3 +1,4 @@
-(preproc_arg) @glsl
+; inherits: c
-(comment) @comment
+((preproc_arg) @injection.content
+ (#set! injection.language "glsl"))
diff --git a/runtime/queries/julia/injections.scm b/runtime/queries/julia/injections.scm
index be2412c0..3cf7339f 100644
--- a/runtime/queries/julia/injections.scm
+++ b/runtime/queries/julia/injections.scm
@@ -1,5 +1,7 @@
; TODO: re-add when markdown is added.
-; ((triple_string) @markdown
-; (#offset! @markdown 0 3 0 -3))
+; ((triple_string) @injection.content
+; (#offset! @injection.content 0 3 0 -3)
+; (#set! injection.language "markdown"))
-(comment) @comment
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm
index 2e308f77..0a030b31 100644
--- a/runtime/queries/latex/highlights.scm
+++ b/runtime/queries/latex/highlights.scm
@@ -371,7 +371,7 @@
((generic_command
name:(generic_command_name) @_name
.
- arg: (_) @markup.underline.link)
+ arg: (_) @markup.link.url)
(#match? @_name "^(\\\\url|\\\\href)$"))
(ERROR) @error
diff --git a/runtime/queries/ledger/injections.scm b/runtime/queries/ledger/injections.scm
index 2d948141..c1714786 100644
--- a/runtime/queries/ledger/injections.scm
+++ b/runtime/queries/ledger/injections.scm
@@ -1,2 +1,2 @@
-(comment) @comment
-(note) @comment
+([(comment) (note)] @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/llvm-mir-yaml/highlights.scm b/runtime/queries/llvm-mir-yaml/highlights.scm
new file mode 100644
index 00000000..4ba254e8
--- /dev/null
+++ b/runtime/queries/llvm-mir-yaml/highlights.scm
@@ -0,0 +1 @@
+; inherits: yaml
diff --git a/runtime/queries/llvm-mir-yaml/indents.toml b/runtime/queries/llvm-mir-yaml/indents.toml
new file mode 100644
index 00000000..ddc3578b
--- /dev/null
+++ b/runtime/queries/llvm-mir-yaml/indents.toml
@@ -0,0 +1,3 @@
+indent = [
+ "block_mapping_pair",
+]
diff --git a/runtime/queries/llvm-mir-yaml/injections.scm b/runtime/queries/llvm-mir-yaml/injections.scm
new file mode 100644
index 00000000..b3243022
--- /dev/null
+++ b/runtime/queries/llvm-mir-yaml/injections.scm
@@ -0,0 +1,9 @@
+; inherits: yaml
+
+((document (block_node (block_scalar) @injection.content))
+ (#set! injection.language "llvm"))
+
+((document (block_node (block_mapping (block_mapping_pair
+ key: (flow_node (plain_scalar (string_scalar))) ; "body"
+ value: (block_node (block_scalar) @injection.content)))))
+ (#set! injection.language "mir"))
diff --git a/runtime/queries/llvm-mir/highlights.scm b/runtime/queries/llvm-mir/highlights.scm
new file mode 100644
index 00000000..79234612
--- /dev/null
+++ b/runtime/queries/llvm-mir/highlights.scm
@@ -0,0 +1,136 @@
+[
+ (label)
+ (bb_ref)
+] @label
+
+[
+ (comment)
+ (multiline_comment)
+] @comment
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+ "<"
+ ">"
+] @punctuation.bracket
+
+[
+ ","
+ ":"
+ "|"
+ "*"
+] @punctuation.delimiter
+
+[
+ "="
+ "x"
+] @operator
+
+[
+ "true"
+ "false"
+] @constant.builtin.boolean
+
+[
+ "null"
+ "_"
+ "unknown-address"
+] @constant.builtin
+
+[
+ (stack_object)
+ (constant_pool_index)
+ (jump_table_index)
+ (var)
+ (physical_register)
+ (ir_block)
+ (external_symbol)
+ (global_var)
+ (ir_local_var)
+ (metadata_ref)
+ (mnemonic)
+] @variable
+
+(low_level_type) @type
+
+[
+ (immediate_type)
+ (primitive_type)
+] @type.builtin
+
+(number) @constant.numeric.integer
+(float) @constant.numeric.float
+(string) @string
+
+(instruction name: _ @keyword.operator)
+
+[
+ "successors"
+ "liveins"
+ "pre-instr-symbol"
+ "post-instr-symbol"
+ "heap-alloc-marker"
+ "debug-instr-number"
+ "debug-location"
+ "mcsymbol"
+ "tied-def"
+ "target-flags"
+ "CustomRegMask"
+ "same_value"
+ "def_cfa_register"
+ "restore"
+ "undefined"
+ "offset"
+ "rel_offset"
+ "def_cfa"
+ "llvm_def_aspace_cfa"
+ "register"
+ "escape"
+ "remember_state"
+ "restore_state"
+ "window_save"
+ "negate_ra_sign_state"
+ "intpred"
+ "floatpred"
+ "shufflemask"
+ "liveout"
+ "target-index"
+ "blockaddress"
+ "intrinsic"
+ "load"
+ "store"
+ "unknown-size"
+ "on"
+ "from"
+ "into"
+ "align"
+ "basealign"
+ "addrspace"
+ "call-entry"
+ "custom"
+ "constant-pool"
+ "stack"
+ "got"
+ "jump-table"
+ "syncscope"
+ "address-taken"
+ "landing-pad"
+ "inlineasm-br-indirect-target"
+ "ehfunclet-entry"
+ "bbsections"
+
+ (intpred)
+ (floatpred)
+ (memory_operand_flag)
+ (atomic_ordering)
+ (register_flag)
+ (instruction_flag)
+ (float_keyword)
+] @keyword
+
+(ERROR) @error
diff --git a/runtime/queries/llvm-mir/indents.toml b/runtime/queries/llvm-mir/indents.toml
new file mode 100644
index 00000000..6a70e5ad
--- /dev/null
+++ b/runtime/queries/llvm-mir/indents.toml
@@ -0,0 +1,7 @@
+indent = [
+ "basic_block",
+]
+
+outdent = [
+ "label",
+]
diff --git a/runtime/queries/llvm-mir/injections.scm b/runtime/queries/llvm-mir/injections.scm
new file mode 100644
index 00000000..0b476f86
--- /dev/null
+++ b/runtime/queries/llvm-mir/injections.scm
@@ -0,0 +1,2 @@
+([ (comment) (multiline_comment)] @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/llvm-mir/textobjects.scm b/runtime/queries/llvm-mir/textobjects.scm
new file mode 100644
index 00000000..73f6f772
--- /dev/null
+++ b/runtime/queries/llvm-mir/textobjects.scm
@@ -0,0 +1,3 @@
+(basic_block) @function.around
+
+(argument) @parameter.inside
diff --git a/runtime/queries/llvm/highlights.scm b/runtime/queries/llvm/highlights.scm
index 73afe85e..cb705197 100644
--- a/runtime/queries/llvm/highlights.scm
+++ b/runtime/queries/llvm/highlights.scm
@@ -1,14 +1,158 @@
(type) @type
-(statement) @keyword.operator
+(type_keyword) @type.builtin
+
+(type [
+ (local_var)
+ (global_var)
+ ] @type)
+
+(argument) @variable.parameter
+
+(_ inst_name: _ @keyword.operator)
+
+[
+ "catch"
+ "filter"
+] @keyword.operator
+
+[
+ "to"
+ "nuw"
+ "nsw"
+ "exact"
+ "unwind"
+ "from"
+ "cleanup"
+ "swifterror"
+ "volatile"
+ "inbounds"
+ "inrange"
+ (icmp_cond)
+ (fcmp_cond)
+ (fast_math)
+] @keyword.control
+
+(_ callee: _ @function)
+(function_header name: _ @function)
+
+[
+ "declare"
+ "define"
+ (calling_conv)
+] @keyword.function
+
+[
+ "target"
+ "triple"
+ "datalayout"
+ "source_filename"
+ "addrspace"
+ "blockaddress"
+ "align"
+ "syncscope"
+ "within"
+ "uselistorder"
+ "uselistorder_bb"
+ "module"
+ "asm"
+ "sideeffect"
+ "alignstack"
+ "inteldialect"
+ "unwind"
+ "type"
+ "global"
+ "constant"
+ "externally_initialized"
+ "alias"
+ "ifunc"
+ "section"
+ "comdat"
+ "thread_local"
+ "localdynamic"
+ "initialexec"
+ "localexec"
+ "any"
+ "exactmatch"
+ "largest"
+ "nodeduplicate"
+ "samesize"
+ "distinct"
+ "attributes"
+ "vscale"
+ "no_cfi"
+ (linkage_aux)
+ (dso_local)
+ (visibility)
+ (dll_storage_class)
+ (unnamed_addr)
+ (attribute_name)
+] @keyword
+
+
+(function_header [
+ (linkage)
+ (calling_conv)
+ (unnamed_addr)
+ ] @keyword.function)
+
+[
+ (string)
+ (cstring)
+] @string
+
(number) @constant.numeric.integer
(comment) @comment
-(string) @string
(label) @label
-(keyword) @keyword
-"ret" @keyword.control.return
-(boolean) @constant.builtin.boolean
+(_ inst_name: "ret" @keyword.control.return)
(float) @constant.numeric.float
-(constant) @constant
-(identifier) @variable
-(symbol) @punctuation.delimiter
-(bracket) @punctuation.bracket
+
+[
+ (local_var)
+ (global_var)
+] @variable
+
+[
+ (struct_value)
+ (array_value)
+ (vector_value)
+] @constructor
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+ "<"
+ ">"
+ "<{"
+ "}>"
+] @punctuation.bracket
+
+[
+ ","
+ ":"
+] @punctuation.delimiter
+
+[
+ "="
+ "|"
+ "x"
+ "..."
+] @operator
+
+[
+ "true"
+ "false"
+] @constant.builtin.boolean
+
+[
+ "undef"
+ "poison"
+ "null"
+ "none"
+ "zeroinitializer"
+] @constant.builtin
+
+(ERROR) @error
diff --git a/runtime/queries/llvm/indents.toml b/runtime/queries/llvm/indents.toml
new file mode 100644
index 00000000..8cd603c8
--- /dev/null
+++ b/runtime/queries/llvm/indents.toml
@@ -0,0 +1,8 @@
+indent = [
+ "function_body",
+ "instruction",
+]
+
+outdent = [
+ "}",
+]
diff --git a/runtime/queries/llvm/injections.scm b/runtime/queries/llvm/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/llvm/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/llvm/locals.scm b/runtime/queries/llvm/locals.scm
new file mode 100644
index 00000000..1946c287
--- /dev/null
+++ b/runtime/queries/llvm/locals.scm
@@ -0,0 +1,14 @@
+; Scopes
+
+(function_body) @local.scope
+
+; Definitions
+
+(argument
+ (value (var (local_var) @local.definition)))
+
+(instruction
+ (local_var) @local.definition)
+
+; References
+(local_var) @local.reference
diff --git a/runtime/queries/llvm/textobjects.scm b/runtime/queries/llvm/textobjects.scm
new file mode 100644
index 00000000..3738a3bb
--- /dev/null
+++ b/runtime/queries/llvm/textobjects.scm
@@ -0,0 +1,16 @@
+(define
+ body: (_) @function.inside) @function.around
+
+(struct_type
+ (struct_body) @class.inside) @class.around
+
+(packed_struct_type
+ (struct_body) @class.inside) @class.around
+
+(array_type
+ (array_vector_body) @class.inside) @class.around
+
+(vector_type
+ (array_vector_body) @class.inside) @class.around
+
+(argument) @parameter.inside
diff --git a/runtime/queries/markdown/highlights.scm b/runtime/queries/markdown/highlights.scm
index a102719b..a0bd3462 100644
--- a/runtime/queries/markdown/highlights.scm
+++ b/runtime/queries/markdown/highlights.scm
@@ -10,15 +10,16 @@
(fenced_code_block)
] @markup.raw.block
+(block_quote) @markup.quote
+
(code_span) @markup.raw.inline
(emphasis) @markup.italic
(strong_emphasis) @markup.bold
-(link_destination) @markup.underline.link
-
-; (link_label) @markup.label ; TODO: rename
+(link_destination) @markup.link.url
+(link_label) @markup.link.label
[
(list_marker_plus)
diff --git a/runtime/queries/markdown/injections.scm b/runtime/queries/markdown/injections.scm
index ff3c5fe6..10dcab0b 100644
--- a/runtime/queries/markdown/injections.scm
+++ b/runtime/queries/markdown/injections.scm
@@ -1,6 +1,7 @@
(fenced_code_block
(info_string) @injection.language
- (code_fence_content) @injection.content)
+ (code_fence_content) @injection.content
+ (#set! injection.include-children))
((html_block) @injection.content
(#set! injection.language "html"))
diff --git a/runtime/queries/nix/highlights.scm b/runtime/queries/nix/highlights.scm
index 66719e87..f6682065 100644
--- a/runtime/queries/nix/highlights.scm
+++ b/runtime/queries/nix/highlights.scm
@@ -13,7 +13,7 @@
] @keyword
((identifier) @variable.builtin
- (#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins|false|null|true)$")
+ (#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins)$")
(#is-not? local))
((identifier) @function.builtin
@@ -33,6 +33,11 @@
(uri) @string.special.uri
+; boolean
+((identifier) @constant.builtin.boolean (#match? @constant.builtin.boolean "^(true|false)$")) @constant.builtin.boolean
+; null
+((identifier) @constant.builtin (#eq? @constant.builtin "null")) @constant.builtin
+
(integer) @constant.numeric.integer
(float) @constant.numeric.float
diff --git a/runtime/queries/ocaml/indents.toml b/runtime/queries/ocaml/indents.toml
index 9b6462d8..7586b83a 100644
--- a/runtime/queries/ocaml/indents.toml
+++ b/runtime/queries/ocaml/indents.toml
@@ -8,6 +8,6 @@ indent = [
"match_case",
]
-oudent = [
+outdent = [
"}",
]
diff --git a/runtime/queries/python/injections.scm b/runtime/queries/python/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/python/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/ruby/indents.toml b/runtime/queries/ruby/indents.toml
new file mode 100644
index 00000000..b417751f
--- /dev/null
+++ b/runtime/queries/ruby/indents.toml
@@ -0,0 +1,25 @@
+indent = [
+ "argument_list",
+ "array",
+ "begin",
+ "block",
+ "call",
+ "class",
+ "case",
+ "do_block",
+ "elsif",
+ "if",
+ "hash",
+ "method",
+ "module",
+ "singleton_class",
+ "singleton_method",
+]
+
+outdent = [
+ ")",
+ "}",
+ "]",
+ "end",
+ "when",
+]
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index 539d9550..26496c66 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -127,11 +127,16 @@
"await"
] @keyword.control
+"use" @keyword.control.import
+(mod_item "mod" @keyword.control.import !body)
+(use_as_clause "as" @keyword.control.import)
+
+(type_cast_expression "as" @keyword.operator)
+
[
(crate)
(super)
"as"
- "use"
"pub"
"mod"
"extern"
@@ -242,10 +247,9 @@
; ---
; Macros
; ---
-
(meta_item
- (identifier) @attribute)
-(attribute_item) @attribute
+ (identifier) @function.macro)
+
(inner_attribute_item) @attribute
(macro_definition
@@ -259,7 +263,7 @@
"!" @function.macro)
(metavariable) @variable.parameter
-(fragment_specifier) @variable.parameter
+(fragment_specifier) @type
diff --git a/runtime/queries/rust/indents.toml b/runtime/queries/rust/indents.toml
index 3900f0b9..51a0ceea 100644
--- a/runtime/queries/rust/indents.toml
+++ b/runtime/queries/rust/indents.toml
@@ -9,6 +9,7 @@ indent = [
"field_initializer_list",
"struct_pattern",
"tuple_pattern",
+ "unit_expression",
"enum_variant_list",
"call_expression",
"binary_expression",
diff --git a/runtime/queries/rust/injections.scm b/runtime/queries/rust/injections.scm
index 6035d418..d8382e49 100644
--- a/runtime/queries/rust/injections.scm
+++ b/runtime/queries/rust/injections.scm
@@ -1,3 +1,6 @@
+([(line_comment) (block_comment)] @injection.content
+ (#set! injection.language "comment"))
+
((macro_invocation
(token_tree) @injection.content)
(#set! injection.language "rust")
diff --git a/runtime/queries/scala/highlights.scm b/runtime/queries/scala/highlights.scm
new file mode 100644
index 00000000..50a6e18a
--- /dev/null
+++ b/runtime/queries/scala/highlights.scm
@@ -0,0 +1,203 @@
+; CREDITS @stumash (stuart.mashaal@gmail.com)
+
+;; variables
+
+
+((identifier) @variable.builtin
+ (#match? @variable.builtin "^this$"))
+
+(interpolation) @none
+
+; Assume other uppercase names constants.
+; NOTE: In order to distinguish constants we highlight
+; all the identifiers that are uppercased. But this solution
+; is not suitable for all occurrences e.g. it will highlight
+; an uppercased method as a constant if used with no params.
+; Introducing highlighting for those specific cases, is probably
+; best way to resolve the issue.
+((identifier) @constant (#match? @constant "^[A-Z]"))
+
+;; types
+
+(type_identifier) @type
+
+(class_definition
+ name: (identifier) @type)
+
+(object_definition
+ name: (identifier) @type)
+
+(trait_definition
+ name: (identifier) @type)
+
+(type_definition
+ name: (type_identifier) @type)
+
+; method definition
+
+(class_definition
+ body: (template_body
+ (function_definition
+ name: (identifier) @function.method)))
+(object_definition
+ body: (template_body
+ (function_definition
+ name: (identifier) @function.method)))
+(trait_definition
+ body: (template_body
+ (function_definition
+ name: (identifier) @function.method)))
+
+; imports
+
+(import_declaration
+ path: (identifier) @namespace)
+((stable_identifier (identifier) @namespace))
+
+((import_declaration
+ path: (identifier) @type) (#match? @type "^[A-Z]"))
+((stable_identifier (identifier) @type) (#match? @type "^[A-Z]"))
+
+((import_selectors (identifier) @type) (#match? @type "^[A-Z]"))
+
+; method invocation
+
+
+(call_expression
+ function: (identifier) @function)
+
+(call_expression
+ function: (field_expression
+ field: (identifier) @function.method))
+
+((call_expression
+ function: (identifier) @variable.other.member)
+ (#match? @variable.other.member "^[A-Z]"))
+
+(generic_function
+ function: (identifier) @function)
+
+(
+ (identifier) @function.builtin
+ (#match? @function.builtin "^super$")
+)
+
+; function definitions
+
+(function_definition
+ name: (identifier) @function)
+
+(parameter
+ name: (identifier) @variable.parameter)
+
+; expressions
+
+
+(field_expression field: (identifier) @variable.other.member)
+(field_expression value: (identifier) @type
+ (#match? @type "^[A-Z]"))
+
+(infix_expression operator: (identifier) @operator)
+(infix_expression operator: (operator_identifier) @operator)
+(infix_type operator: (operator_identifier) @operator)
+(infix_type operator: (operator_identifier) @operator)
+
+; literals
+(boolean_literal) @constant.builtin.boolean
+(integer_literal) @constant.numeric.integer
+(floating_point_literal) @constant.numeric.float
+
+
+(symbol_literal) @string.special.symbol
+
+[
+(string)
+(character_literal)
+(interpolated_string_expression)
+] @string
+
+(interpolation "$" @punctuation.special)
+
+;; keywords
+
+[
+ "abstract"
+ "case"
+ "class"
+ "extends"
+ "final"
+ "finally"
+;; `forSome` existential types not implemented yet
+ "implicit"
+ "lazy"
+;; `macro` not implemented yet
+ "object"
+ "override"
+ "package"
+ "private"
+ "protected"
+ "sealed"
+ "trait"
+ "type"
+ "val"
+ "var"
+ "with"
+] @keyword
+
+(null_literal) @constant.builtin
+(wildcard) @keyword
+
+;; special keywords
+
+"new" @keyword.operator
+
+[
+ "else"
+ "if"
+ "match"
+ "try"
+ "catch"
+ "throw"
+] @keyword.control.conditional
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ "."
+ ","
+] @punctuation.delimiter
+
+[
+ "do"
+ "for"
+ "while"
+ "yield"
+] @keyword.control.repeat
+
+"def" @keyword.function
+
+[
+ "=>"
+ "<-"
+ "@"
+] @keyword.operator
+
+"import" @keyword.control.import
+
+"return" @keyword.control.return
+
+(comment) @comment
+
+;; `case` is a conditional keyword in case_block
+
+(case_block
+ (case_clause ("case") @keyword.control.conditional))
+
+(identifier) @variable \ No newline at end of file
diff --git a/runtime/queries/scala/indents.toml b/runtime/queries/scala/indents.toml
new file mode 100644
index 00000000..6de54844
--- /dev/null
+++ b/runtime/queries/scala/indents.toml
@@ -0,0 +1,23 @@
+
+indent = [
+ "block",
+ "arguments",
+ "parameter",
+ "class_definition",
+ "trait_definition",
+ "object_definition",
+ "function_definition",
+ "val_definition",
+ "import_declaration",
+ "while_expression",
+ "do_while_expression",
+ "for_expression",
+ "try_expression",
+ "match_expression"
+]
+
+outdent = [
+ "}",
+ "]",
+ ")"
+]
diff --git a/runtime/queries/scala/injections.scm b/runtime/queries/scala/injections.scm
new file mode 100644
index 00000000..4bb7d675
--- /dev/null
+++ b/runtime/queries/scala/injections.scm
@@ -0,0 +1 @@
+(comment) @comment
diff --git a/runtime/queries/svelte/highlights.scm b/runtime/queries/svelte/highlights.scm
index f9eef6b5..22b0c551 100644
--- a/runtime/queries/svelte/highlights.scm
+++ b/runtime/queries/svelte/highlights.scm
@@ -20,12 +20,12 @@
((element (start_tag (tag_name) @_tag) (text) @markup.inline)
(#match? @_tag "^(code|kbd)$"))
-((element (start_tag (tag_name) @_tag) (text) @markup.underline.link)
+((element (start_tag (tag_name) @_tag) (text) @markup.link.url)
(#eq? @_tag "a"))
((attribute
(attribute_name) @_attr
- (quoted_attribute_value (attribute_value) @markup.underline.link))
+ (quoted_attribute_value (attribute_value) @markup.link.url))
(#match? @_attr "^(href|src)$"))
(tag_name) @tag
diff --git a/runtime/queries/svelte/injections.scm b/runtime/queries/svelte/injections.scm
index 266f4701..04e860cf 100644
--- a/runtime/queries/svelte/injections.scm
+++ b/runtime/queries/svelte/injections.scm
@@ -26,5 +26,5 @@
(#set! injection.language "typescript")
)
-(comment) @comment
-
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/tablegen/highlights.scm b/runtime/queries/tablegen/highlights.scm
new file mode 100644
index 00000000..8ade5ba9
--- /dev/null
+++ b/runtime/queries/tablegen/highlights.scm
@@ -0,0 +1,90 @@
+[
+ (comment)
+ (multiline_comment)
+] @comment
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+ "<"
+ ">"
+] @punctuation.bracket
+
+[
+ ","
+ ";"
+ "."
+] @punctuation.delimiter
+
+[
+ "#"
+ "-"
+ "..."
+ ":"
+] @operator
+
+[
+ "="
+ "!cond"
+ (operator_keyword)
+] @function
+
+[
+ "true"
+ "false"
+] @constant.builtin.boolean
+
+[
+ "?"
+] @constant.builtin
+
+(var) @variable
+
+(template_arg (identifier) @variable.parameter)
+
+(_ argument: (value (identifier) @variable.parameter))
+
+(type) @type
+
+"code" @type.builtin
+
+(number) @constant.numeric.integer
+[
+ (string_string)
+ (code_string)
+] @string
+
+(preprocessor) @keyword.directive
+
+[
+ "class"
+ "field"
+ "let"
+ "defvar"
+ "def"
+ "defset"
+ "defvar"
+ "assert"
+] @keyword
+
+[
+ "let"
+ "in"
+ "foreach"
+ "if"
+ "then"
+ "else"
+] @keyword.operator
+
+"include" @keyword.control.import
+
+[
+ "multiclass"
+ "defm"
+] @namespace
+
+(ERROR) @error
diff --git a/runtime/queries/tablegen/indents.toml b/runtime/queries/tablegen/indents.toml
new file mode 100644
index 00000000..43532f4d
--- /dev/null
+++ b/runtime/queries/tablegen/indents.toml
@@ -0,0 +1,7 @@
+indent = [
+ "statement",
+]
+
+outdent = [
+ "}",
+]
diff --git a/runtime/queries/tablegen/injections.scm b/runtime/queries/tablegen/injections.scm
new file mode 100644
index 00000000..0b476f86
--- /dev/null
+++ b/runtime/queries/tablegen/injections.scm
@@ -0,0 +1,2 @@
+([ (comment) (multiline_comment)] @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/tablegen/textobjects.scm b/runtime/queries/tablegen/textobjects.scm
new file mode 100644
index 00000000..2cb80268
--- /dev/null
+++ b/runtime/queries/tablegen/textobjects.scm
@@ -0,0 +1,7 @@
+(class
+ body: (_) @class.inside) @class.around
+
+(multiclass
+ body: (_) @class.inside) @class.around
+
+(_ argument: _ @parameter.inside)
diff --git a/runtime/queries/tsq/injections.scm b/runtime/queries/tsq/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/tsq/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/yaml/highlights.scm b/runtime/queries/yaml/highlights.scm
index a7efb5e7..e4fed27a 100644
--- a/runtime/queries/yaml/highlights.scm
+++ b/runtime/queries/yaml/highlights.scm
@@ -1,9 +1,19 @@
-(block_mapping_pair key: (_) @variable.other.member)
-(flow_mapping (_ key: (_) @variable.other.member))
+(block_mapping_pair
+ key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @variable.other.member))
+(block_mapping_pair
+ key: (flow_node (plain_scalar (string_scalar) @variable.other.member)))
+
+(flow_mapping
+ (_ key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @variable.other.member)))
+(flow_mapping
+ (_ key: (flow_node (plain_scalar (string_scalar) @variable.other.member))))
+
(boolean_scalar) @constant.builtin.boolean
(null_scalar) @constant.builtin
(double_quote_scalar) @string
(single_quote_scalar) @string
+(block_scalar) @string
+(string_scalar) @string
(escape_sequence) @constant.character.escape
(integer_scalar) @constant.numeric.integer
(float_scalar) @constant.numeric.float
@@ -30,4 +40,4 @@
"}"
] @punctuation.bracket
-["*" "&"] @punctuation.special
+["*" "&" "---" "..."] @punctuation.special
diff --git a/runtime/queries/yaml/injections.scm b/runtime/queries/yaml/injections.scm
new file mode 100644
index 00000000..39bda293
--- /dev/null
+++ b/runtime/queries/yaml/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))