Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glsl support #993

Merged
merged 3 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,7 @@
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
1 change: 1 addition & 0 deletions helix-syntax/languages/tree-sitter-glsl
Submodule tree-sitter-glsl added at 88408f
9 changes: 9 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,12 @@ roots = []
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 = " " }

1 change: 1 addition & 0 deletions runtime/queries/glsl/folds.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
; inherits: c
37 changes: 37 additions & 0 deletions runtime/queries/glsl/highlights.scm
Original file line number Diff line number Diff line change
@@ -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_")
)
1 change: 1 addition & 0 deletions runtime/queries/glsl/indents.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
; inherits: c
matszczygiel marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions runtime/queries/glsl/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(preproc_arg) @glsl

(comment) @comment
1 change: 1 addition & 0 deletions runtime/queries/glsl/locals.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
; inherits: c