glsl support (#993)
* add glsl language support * glsl: use indents.toml file
This commit is contained in:
parent
549cdee561
commit
3f0345ff58
8 changed files with 74 additions and 0 deletions
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -134,6 +134,10 @@
|
|||
path = helix-syntax/languages/tree-sitter-cmake
|
||||
url = https://github.com/uyha/tree-sitter-cmake
|
||||
shallow = true
|
||||
[submodule "helix-syntax/languages/tree-sitter-glsl"]
|
||||
path = helix-syntax/languages/tree-sitter-glsl
|
||||
url = https://github.com/theHamsta/tree-sitter-glsl.git
|
||||
shallow = true
|
||||
[submodule "helix-syntax/languages/tree-sitter-perl"]
|
||||
path = helix-syntax/languages/tree-sitter-perl
|
||||
url = https://github.com/ganezdragon/tree-sitter-perl
|
||||
|
|
1
helix-syntax/languages/tree-sitter-glsl
Submodule
1
helix-syntax/languages/tree-sitter-glsl
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 88408ffc5e27abcffced7010fc77396ae3636d7e
|
|
@ -401,6 +401,14 @@ comment-token = "#"
|
|||
indent = { tab-width = 2, unit = " " }
|
||||
language-server = { command = "cmake-language-server" }
|
||||
|
||||
[[language]]
|
||||
name = "glsl"
|
||||
scope = "source.glsl"
|
||||
file-types = ["glsl", "vert", "tesc", "tese", "geom", "frag", "comp" ]
|
||||
roots = []
|
||||
comment-token = "//"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "perl"
|
||||
scope = "source.perl"
|
||||
|
|
1
runtime/queries/glsl/folds.scm
Normal file
1
runtime/queries/glsl/folds.scm
Normal file
|
@ -0,0 +1 @@
|
|||
; inherits: c
|
37
runtime/queries/glsl/highlights.scm
Normal file
37
runtime/queries/glsl/highlights.scm
Normal file
|
@ -0,0 +1,37 @@
|
|||
; inherits: c
|
||||
|
||||
[
|
||||
"in"
|
||||
"out"
|
||||
"inout"
|
||||
"uniform"
|
||||
"shared"
|
||||
"layout"
|
||||
"attribute"
|
||||
"varying"
|
||||
"buffer"
|
||||
"coherent"
|
||||
"readonly"
|
||||
"writeonly"
|
||||
"precision"
|
||||
"highp"
|
||||
"mediump"
|
||||
"lowp"
|
||||
"centroid"
|
||||
"sample"
|
||||
"patch"
|
||||
"smooth"
|
||||
"flat"
|
||||
"noperspective"
|
||||
"invariant"
|
||||
"precise"
|
||||
] @keyword
|
||||
|
||||
"subroutine" @keyword.function
|
||||
|
||||
(extension_storage_class) @attribute
|
||||
|
||||
(
|
||||
(identifier) @variable.builtin
|
||||
(#match? @variable.builtin "^gl_")
|
||||
)
|
19
runtime/queries/glsl/indents.toml
Normal file
19
runtime/queries/glsl/indents.toml
Normal file
|
@ -0,0 +1,19 @@
|
|||
indent = [
|
||||
"init_declarator",
|
||||
"compound_statement",
|
||||
"preproc_arg",
|
||||
"field_declaration_list",
|
||||
"case_statement",
|
||||
"conditional_expression",
|
||||
"enumerator_list",
|
||||
"struct_specifier",
|
||||
"compound_literal_expression"
|
||||
]
|
||||
|
||||
outdent = [
|
||||
"#define",
|
||||
"#ifdef",
|
||||
"#endif",
|
||||
"{",
|
||||
"}"
|
||||
]
|
3
runtime/queries/glsl/injections.scm
Normal file
3
runtime/queries/glsl/injections.scm
Normal file
|
@ -0,0 +1,3 @@
|
|||
(preproc_arg) @glsl
|
||||
|
||||
(comment) @comment
|
1
runtime/queries/glsl/locals.scm
Normal file
1
runtime/queries/glsl/locals.scm
Normal file
|
@ -0,0 +1 @@
|
|||
; inherits: c
|
Loading…
Add table
Reference in a new issue