aboutsummaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/bpftrace/highlights.scm229
-rw-r--r--runtime/queries/bpftrace/injections.scm12
-rw-r--r--runtime/queries/fish/highlights.scm29
-rw-r--r--runtime/queries/haskell/highlights.scm8
-rw-r--r--runtime/queries/html_tags/highlights.scm6
-rw-r--r--runtime/queries/kos/highlights.scm17
-rw-r--r--runtime/queries/rust/highlights.scm5
-rw-r--r--runtime/queries/typst/highlights.scm12
-rw-r--r--runtime/queries/usd/highlights.scm2
9 files changed, 298 insertions, 22 deletions
diff --git a/runtime/queries/bpftrace/highlights.scm b/runtime/queries/bpftrace/highlights.scm
new file mode 100644
index 000000000..19e568515
--- /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: (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: (identifier) @variable
+ function: (identifier) @property)
+
+(probe
+ provider: (ustd_provider) @type.builtin
+ binary: (file_identifier) @string.special.path
+ function: (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/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/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/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/kos/highlights.scm b/runtime/queries/kos/highlights.scm
index 0942b2b89..07757d2e3 100644
--- a/runtime/queries/kos/highlights.scm
+++ b/runtime/queries/kos/highlights.scm
@@ -4,8 +4,13 @@
(number) @number
+(float_number) @number.float
+
(identifier) @variable
+(parameter
+ parameter: (identifier) @variable.parameter)
+
(property_identifier) @property
[
@@ -57,8 +62,9 @@
"=>"
] @keyword.function
+"_" @character.special
+
[
- "_"
(line)
"assert"
;"async"
@@ -96,6 +102,15 @@
"}"
] @punctuation.bracket
+(string_literal_begin
+ "\\(" @punctuation.special)
+
+(string_literal_continuation
+ "\\(" @punctuation.special)
+
+(formatted_string
+ ")" @punctuation.special)
+
[
";"
":"
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/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/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