mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-08-17 12:00:22 +03:00
Add language support for WGSL (#1166)
This commit is contained in:
parent
6e62c3de47
commit
4ec20eaeff
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -142,3 +142,7 @@
|
||||
path = helix-syntax/languages/tree-sitter-perl
|
||||
url = https://github.com/ganezdragon/tree-sitter-perl
|
||||
shallow = true
|
||||
[submodule "helix-syntax/languages/tree-sitter-wgsl"]
|
||||
path = helix-syntax/languages/tree-sitter-wgsl
|
||||
url = https://github.com/szebniok/tree-sitter-wgsl
|
||||
shallow = true
|
||||
|
1
helix-syntax/languages/tree-sitter-wgsl
Submodule
1
helix-syntax/languages/tree-sitter-wgsl
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f00ff52251edbd58f4d39c9c3204383253032c11
|
@ -405,3 +405,11 @@ file-types = ["rkt"]
|
||||
shebangs = ["racket"]
|
||||
comment-token = ";"
|
||||
language-server = { command = "racket", args = ["-l", "racket-langserver"] }
|
||||
|
||||
[[language]]
|
||||
name = "wgsl"
|
||||
scope = "source.wgsl"
|
||||
file-types = ["wgsl"]
|
||||
roots = []
|
||||
comment-token = "//"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
102
runtime/queries/wgsl/highlights.scm
Normal file
102
runtime/queries/wgsl/highlights.scm
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user