aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/haskell/highlights.scm2
-rw-r--r--runtime/queries/julia/locals.scm22
-rw-r--r--runtime/queries/latex/highlights.scm28
-rw-r--r--runtime/queries/ledger/highlights.scm2
-rw-r--r--runtime/queries/llvm/highlights.scm14
-rw-r--r--runtime/queries/markdown/highlights.scm35
-rw-r--r--runtime/queries/markdown/injections.scm8
-rw-r--r--runtime/queries/ocaml/highlights.scm2
-rw-r--r--runtime/queries/perl/indents.toml17
-rw-r--r--runtime/queries/svelte/highlights.scm2
-rw-r--r--runtime/queries/wgsl/highlights.scm102
11 files changed, 205 insertions, 29 deletions
diff --git a/runtime/queries/haskell/highlights.scm b/runtime/queries/haskell/highlights.scm
index 72187876..8006cb07 100644
--- a/runtime/queries/haskell/highlights.scm
+++ b/runtime/queries/haskell/highlights.scm
@@ -8,7 +8,7 @@
(constructor) @constructor
(pragma) @pragma
(comment) @comment
-(signature name: (variable) @fun_type_name)
+(signature name: (variable) @type)
(function name: (variable) @function)
(constraint class: (class_name (type)) @class)
(class (class_head class: (class_name (type)) @class))
diff --git a/runtime/queries/julia/locals.scm b/runtime/queries/julia/locals.scm
index f8b34f71..d5ac794e 100644
--- a/runtime/queries/julia/locals.scm
+++ b/runtime/queries/julia/locals.scm
@@ -2,24 +2,24 @@
(import_statement
(identifier) @definition.import)
(variable_declaration
- (identifier) @definition.var)
+ (identifier) @local.definition)
(variable_declaration
(tuple_expression
- (identifier) @definition.var))
+ (identifier) @local.definition))
(for_binding
- (identifier) @definition.var)
+ (identifier) @local.definition)
(for_binding
(tuple_expression
- (identifier) @definition.var))
+ (identifier) @local.definition))
(assignment_expression
(tuple_expression
- (identifier) @definition.var))
+ (identifier) @local.definition))
(assignment_expression
(bare_tuple_expression
- (identifier) @definition.var))
+ (identifier) @local.definition))
(assignment_expression
- (identifier) @definition.var)
+ (identifier) @local.definition)
(type_parameter_list
(identifier) @definition.type)
@@ -43,11 +43,11 @@
(identifier) @definition.parameter)
(function_definition
- name: (identifier) @definition.function) @scope
+ name: (identifier) @definition.function) @local.scope
(macro_definition
- name: (identifier) @definition.macro) @scope
+ name: (identifier) @definition.macro) @local.scope
-(identifier) @reference
+(identifier) @local.reference
[
(try_statement)
@@ -56,4 +56,4 @@
(let_statement)
(compound_expression)
(for_statement)
-] @scope
+] @local.scope
diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm
index f045c82d..2e308f77 100644
--- a/runtime/queries/latex/highlights.scm
+++ b/runtime/queries/latex/highlights.scm
@@ -278,7 +278,7 @@
"\\includeinkscape"
"\\usepgflibrary"
"\\usetikzlibrary"
-] @include
+] @keyword.control.import
[
"\\part"
@@ -318,60 +318,60 @@
["[" "]" "{" "}"] @punctuation.bracket ;"(" ")" is has no special meaning in LaTeX
(chapter
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
(part
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
(section
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
(subsection
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
(subsubsection
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
(paragraph
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
(subparagraph
- text: (brace_group) @text.title)
+ text: (brace_group) @markup.heading)
((environment
(begin
name: (word) @_frame)
(brace_group
- child: (text) @text.title))
+ child: (text) @markup.heading))
(#eq? @_frame "frame"))
((generic_command
name:(generic_command_name) @_name
arg: (brace_group
- (text) @text.title))
+ (text) @markup.heading))
(#eq? @_name "\\frametitle"))
;; Formatting
((generic_command
name:(generic_command_name) @_name
- arg: (_) @text.emphasis)
+ arg: (_) @markup.italic)
(#eq? @_name "\\emph"))
((generic_command
name:(generic_command_name) @_name
- arg: (_) @text.emphasis)
+ arg: (_) @markup.italic)
(#match? @_name "^(\\\\textit|\\\\mathit)$"))
((generic_command
name:(generic_command_name) @_name
- arg: (_) @text.strong)
+ arg: (_) @markup.bold)
(#match? @_name "^(\\\\textbf|\\\\mathbf)$"))
((generic_command
name:(generic_command_name) @_name
.
- arg: (_) @text.uri)
+ arg: (_) @markup.underline.link)
(#match? @_name "^(\\\\url|\\\\href)$"))
(ERROR) @error
diff --git a/runtime/queries/ledger/highlights.scm b/runtime/queries/ledger/highlights.scm
index bdf5f2db..02a9ea9a 100644
--- a/runtime/queries/ledger/highlights.scm
+++ b/runtime/queries/ledger/highlights.scm
@@ -12,7 +12,7 @@
((account) @variable.other.member)
((commodity) @text.literal)
-"include" @include
+"include" @keyword.local.import
[
"account"
diff --git a/runtime/queries/llvm/highlights.scm b/runtime/queries/llvm/highlights.scm
new file mode 100644
index 00000000..73afe85e
--- /dev/null
+++ b/runtime/queries/llvm/highlights.scm
@@ -0,0 +1,14 @@
+(type) @type
+(statement) @keyword.operator
+(number) @constant.numeric.integer
+(comment) @comment
+(string) @string
+(label) @label
+(keyword) @keyword
+"ret" @keyword.control.return
+(boolean) @constant.builtin.boolean
+(float) @constant.numeric.float
+(constant) @constant
+(identifier) @variable
+(symbol) @punctuation.delimiter
+(bracket) @punctuation.bracket
diff --git a/runtime/queries/markdown/highlights.scm b/runtime/queries/markdown/highlights.scm
new file mode 100644
index 00000000..a102719b
--- /dev/null
+++ b/runtime/queries/markdown/highlights.scm
@@ -0,0 +1,35 @@
+[
+ (atx_heading)
+ (setext_heading)
+] @markup.heading
+
+(code_fence_content) @none
+
+[
+ (indented_code_block)
+ (fenced_code_block)
+] @markup.raw.block
+
+(code_span) @markup.raw.inline
+
+(emphasis) @markup.italic
+
+(strong_emphasis) @markup.bold
+
+(link_destination) @markup.underline.link
+
+; (link_label) @markup.label ; TODO: rename
+
+[
+ (list_marker_plus)
+ (list_marker_minus)
+ (list_marker_star)
+ (list_marker_dot)
+ (list_marker_parenthesis)
+] @punctuation.special
+
+[
+ (backslash_escape)
+ (hard_line_break)
+] @string.character.escape
+
diff --git a/runtime/queries/markdown/injections.scm b/runtime/queries/markdown/injections.scm
new file mode 100644
index 00000000..ff3c5fe6
--- /dev/null
+++ b/runtime/queries/markdown/injections.scm
@@ -0,0 +1,8 @@
+(fenced_code_block
+ (info_string) @injection.language
+ (code_fence_content) @injection.content)
+
+((html_block) @injection.content
+ (#set! injection.language "html"))
+((html_tag) @injection.content
+ (#set! injection.language "html"))
diff --git a/runtime/queries/ocaml/highlights.scm b/runtime/queries/ocaml/highlights.scm
index 15f46cc1..a08b1267 100644
--- a/runtime/queries/ocaml/highlights.scm
+++ b/runtime/queries/ocaml/highlights.scm
@@ -90,7 +90,7 @@
["exception" "try"] @keyword.control.exception
-["include" "open"] @include
+["include" "open"] @keyword.control.import
["for" "to" "downto" "while" "do" "done"] @keyword.control.repeat
diff --git a/runtime/queries/perl/indents.toml b/runtime/queries/perl/indents.toml
new file mode 100644
index 00000000..365e0663
--- /dev/null
+++ b/runtime/queries/perl/indents.toml
@@ -0,0 +1,17 @@
+indent = [
+ "function",
+ "identifier",
+ "method_invocation",
+ "if_statement",
+ "unless_statement",
+ "if_simple_statement",
+ "unless_simple_statement",
+ "variable_declaration",
+ "block",
+ "list_item",
+ "word_list_qw"
+]
+
+outdent = [
+ "}"
+]
diff --git a/runtime/queries/svelte/highlights.scm b/runtime/queries/svelte/highlights.scm
index 4fcdfd66..f9eef6b5 100644
--- a/runtime/queries/svelte/highlights.scm
+++ b/runtime/queries/svelte/highlights.scm
@@ -25,7 +25,7 @@
((attribute
(attribute_name) @_attr
- (quoted_attribute_value (attribute_value) @markup.undeline.link))
+ (quoted_attribute_value (attribute_value) @markup.underline.link))
(#match? @_attr "^(href|src)$"))
(tag_name) @tag
diff --git a/runtime/queries/wgsl/highlights.scm b/runtime/queries/wgsl/highlights.scm
new file mode 100644
index 00000000..7fbc87d8
--- /dev/null
+++ b/runtime/queries/wgsl/highlights.scm
@@ -0,0 +1,102 @@
+(const_literal) @constant.numeric
+
+(type_declaration) @type
+
+(function_declaration
+ (identifier) @function)
+
+(struct_declaration
+ (identifier) @type)
+
+(type_constructor_or_function_call_expression
+ (type_declaration) @function)
+
+(parameter
+ (variable_identifier_declaration (identifier) @variable.parameter))
+
+[
+ "struct"
+ "bitcast"
+ ; "block"
+ "discard"
+ "enable"
+ "fallthrough"
+ "fn"
+ "let"
+ "private"
+ "read"
+ "read_write"
+ "return"
+ "storage"
+ "type"
+ "uniform"
+ "var"
+ "workgroup"
+ "write"
+ (texel_format)
+] @keyword ; TODO reserved keywords
+
+[
+ (true)
+ (false)
+] @constant.builtin.boolean
+
+[ "," "." ":" ";" ] @punctuation.delimiter
+
+;; brackets
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ "loop"
+ "for"
+ "break"
+ "continue"
+ "continuing"
+] @keyword.control.repeat
+
+[
+ "if"
+ "else"
+ "elseif"
+ "switch"
+ "case"
+ "default"
+] @keyword.control.conditional
+
+[
+ "&"
+ "&&"
+ "/"
+ "!"
+ "="
+ "=="
+ "!="
+ ">"
+ ">="
+ ">>"
+ "<"
+ "<="
+ "<<"
+ "%"
+ "-"
+ "+"
+ "|"
+ "||"
+ "*"
+ "~"
+ "^"
+] @operator
+
+(attribute
+ (identifier) @variable.other.member)
+
+(comment) @comment
+
+(ERROR) @error