Extract GLSL language support into an extension (#10433)

Release Notes:

- Extracted GLSL language support into an extension.

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Max Brunsfeld 2024-04-11 10:52:10 -07:00 committed by GitHub
parent 47f698d5a3
commit c38f72d194
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 24 additions and 25 deletions

10
Cargo.lock generated
View File

@ -5431,7 +5431,6 @@ dependencies = [
"tree-sitter-css",
"tree-sitter-elixir",
"tree-sitter-embedded-template",
"tree-sitter-glsl",
"tree-sitter-go",
"tree-sitter-gomod",
"tree-sitter-gowork",
@ -10353,15 +10352,6 @@ dependencies = [
"tree-sitter",
]
[[package]]
name = "tree-sitter-glsl"
version = "0.1.4"
source = "git+https://github.com/theHamsta/tree-sitter-glsl?rev=2a56fb7bc8bb03a1892b4741279dd0a8758b7fb3#2a56fb7bc8bb03a1892b4741279dd0a8758b7fb3"
dependencies = [
"cc",
"tree-sitter",
]
[[package]]
name = "tree-sitter-go"
version = "0.19.1"

View File

@ -314,7 +314,6 @@ tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev
tree-sitter-css = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" }
tree-sitter-elixir = { git = "https://github.com/elixir-lang/tree-sitter-elixir", rev = "a2861e88a730287a60c11ea9299c033c7d076e30" }
tree-sitter-embedded-template = "0.20.0"
tree-sitter-glsl = { git = "https://github.com/theHamsta/tree-sitter-glsl", rev = "2a56fb7bc8bb03a1892b4741279dd0a8758b7fb3" }
tree-sitter-go = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "aeb2f33b366fd78d5789ff104956ce23508b85db" }
tree-sitter-gomod = { git = "https://github.com/camdencheek/tree-sitter-go-mod" }
tree-sitter-gowork = { git = "https://github.com/d1y/tree-sitter-go-work" }

View File

@ -39,6 +39,8 @@ fn suggested_extensions() -> &'static HashMap<&'static str, Arc<str>> {
("git-firefly", "TAG_EDITMSG"),
("git-firefly", "git-rebase-todo"),
("gleam", "gleam"),
("glsl", "vert"),
("glsl", "frag"),
("graphql", "gql"),
("graphql", "graphql"),
("haskell", "hs"),

View File

@ -42,7 +42,6 @@ tree-sitter-cpp.workspace = true
tree-sitter-css.workspace = true
tree-sitter-elixir.workspace = true
tree-sitter-embedded-template.workspace = true
tree-sitter-glsl.workspace = true
tree-sitter-go.workspace = true
tree-sitter-gomod.workspace = true
tree-sitter-gowork.workspace = true

View File

@ -62,7 +62,6 @@ pub fn init(
"embedded_template",
tree_sitter_embedded_template::language(),
),
("glsl", tree_sitter_glsl::language()),
("go", tree_sitter_go::language()),
("gomod", tree_sitter_gomod::language()),
("gowork", tree_sitter_gowork::language()),
@ -286,7 +285,6 @@ pub fn init(
"yaml",
vec![Arc::new(yaml::YamlLspAdapter::new(node_runtime.clone()))]
);
language!("glsl");
language!("nix");
language!("nu", vec![Arc::new(nu::NuLanguageServer {})]);
language!("ocaml", vec![Arc::new(ocaml::OCamlLspAdapter)]);

View File

@ -0,0 +1 @@
../../LICENSE-APACHE

View File

@ -0,0 +1,11 @@
id = "glsl"
name = "GLSL"
description = "GLSL support."
version = "0.0.1"
schema_version = 1
authors = ["Mikayla Maki <mikayla@zed.dev>"]
repository = "https://github.com/zed-industries/zed"
[grammars.glsl]
repository = "https://github.com/theHamsta/tree-sitter-glsl"
commit = "31064ce53385150f894a6c72d61b94076adf640a"

View File

@ -57,6 +57,14 @@
(number_literal) @number
(char_literal) @number
(identifier) @variable
(field_identifier) @property
(statement_identifier) @label
(type_identifier) @type
(primitive_type) @type
(sized_type_specifier) @type
(call_expression
function: (identifier) @function)
(call_expression
@ -67,19 +75,10 @@
(preproc_function_def
name: (identifier) @function.special)
(field_identifier) @property
(statement_identifier) @label
(type_identifier) @type
(primitive_type) @type
(sized_type_specifier) @type
((identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
(identifier) @variable
(comment) @comment
; inherits: c
[
"in"

View File

@ -3,8 +3,6 @@ ignore-files = true
ignore-hidden = false
extend-exclude = [
".git/",
# glsl isn't recognized by this tool
"crates/languages/src/glsl/",
# File suffixes aren't typos
"assets/icons/file_icons/file_types.json",
"crates/extensions_ui/src/extension_suggest.rs",
@ -17,6 +15,8 @@ extend-exclude = [
"crates/editor/src/editor_tests.rs",
# Clojure uses .edn filename extension, which is not a misspelling of "end"
"extensions/clojure/languages/clojure/config.toml",
# glsl isn't recognized by this tool
"extensions/glsl/languages/glsl/",
# Windows likes its abbreviations
"crates/gpui/src/platform/windows/",
]