mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add support for gdshader (#6153)
Godot shading language --------- Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
This commit is contained in:
parent
4349af8a6e
commit
06b5fda797
5 changed files with 157 additions and 0 deletions
|
|
@ -238,6 +238,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq)
|
||||
- [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
|
||||
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @PrestonKnopp)
|
||||
- [x] [gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) (maintained by @godofavacyn)
|
||||
- [x] [git_config](https://github.com/the-mikedavis/tree-sitter-git-config) (maintained by @amaanq)
|
||||
- [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod)
|
||||
- [x] [gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) (maintained by @ObserverOfTime)
|
||||
|
|
|
|||
|
|
@ -194,6 +194,9 @@
|
|||
"gdscript": {
|
||||
"revision": "b5dea4d852db65f0872d849c24533eb121e03c76"
|
||||
},
|
||||
"gdshader": {
|
||||
"revision": "ffd9f958df13cae04593781d7d2562295a872455"
|
||||
},
|
||||
"git_config": {
|
||||
"revision": "9c2a1b7894e6d9eedfe99805b829b4ecd871375e"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -619,6 +619,15 @@ list.gdscript = {
|
|||
readme_name = "Godot (gdscript)",
|
||||
}
|
||||
|
||||
list.gdshader = {
|
||||
install_info = {
|
||||
url = "https://github.com/GodOfAvacyn/tree-sitter-gdshader",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
filetype = "gdshaderinc",
|
||||
maintainers = { "@godofavacyn" },
|
||||
}
|
||||
|
||||
list.git_rebase = {
|
||||
install_info = {
|
||||
url = "https://github.com/the-mikedavis/tree-sitter-git-rebase",
|
||||
|
|
|
|||
142
queries/gdshader/highlights.scm
Normal file
142
queries/gdshader/highlights.scm
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
[
|
||||
"render_mode"
|
||||
"shader_type"
|
||||
"group_uniforms"
|
||||
"global"
|
||||
"instance"
|
||||
"const"
|
||||
"varying"
|
||||
"uniform"
|
||||
"struct"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(precision_qualifier)
|
||||
(interpolation_qualifier)
|
||||
] @type.qualifier
|
||||
|
||||
[
|
||||
"in"
|
||||
"out"
|
||||
"inout"
|
||||
] @keyword.storage
|
||||
|
||||
[
|
||||
"while"
|
||||
"for"
|
||||
] @keyword.repeat
|
||||
|
||||
[
|
||||
"continue"
|
||||
"break"
|
||||
"return"
|
||||
] @keyword.return
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
"switch"
|
||||
"case"
|
||||
"default"
|
||||
] @keyword.conditional
|
||||
|
||||
[
|
||||
"#"
|
||||
"include"
|
||||
] @keyword.directive
|
||||
|
||||
(string) @string
|
||||
|
||||
[
|
||||
"="
|
||||
"+="
|
||||
"-="
|
||||
"!"
|
||||
"~"
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"||"
|
||||
"&&"
|
||||
"|"
|
||||
"^"
|
||||
"&"
|
||||
"=="
|
||||
"!="
|
||||
">"
|
||||
">="
|
||||
"<="
|
||||
"<"
|
||||
"<<"
|
||||
">>"
|
||||
"++"
|
||||
"--"
|
||||
] @operator
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
(integer) @number
|
||||
|
||||
(float) @number.float
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
(builtin_type) @type.builtin
|
||||
|
||||
(ident_type) @type.definition
|
||||
|
||||
[
|
||||
(shader_type)
|
||||
(render_mode)
|
||||
(hint_name)
|
||||
] @attribute
|
||||
|
||||
(builtin_variable) @constant.builtin
|
||||
|
||||
(builtin_function) @function.builtin
|
||||
|
||||
(group_uniforms_declaration
|
||||
group_name: (ident) @property
|
||||
subgroup_name: (ident) @property)
|
||||
|
||||
(struct_declaration
|
||||
name: (ident) @type)
|
||||
|
||||
(struct_member
|
||||
name: (ident) @property)
|
||||
|
||||
(function_declaration
|
||||
name: (ident) @function)
|
||||
|
||||
(parameter
|
||||
name: (ident) @variable.parameter)
|
||||
|
||||
(member_expr
|
||||
member: (ident) @property)
|
||||
|
||||
(call_expr
|
||||
function:
|
||||
[
|
||||
(ident)
|
||||
(builtin_type)
|
||||
] @function)
|
||||
|
||||
(call_expr
|
||||
function: (builtin_type) @function.call)
|
||||
|
||||
(comment) @comment @spell
|
||||
2
queries/gdshader/injections.scm
Normal file
2
queries/gdshader/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue