From 253aa28375f175ece6123a795e789e69cc0604a3 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 11 Apr 2024 12:45:46 -0700 Subject: [PATCH] Extract Scheme and Racket language support into extensions (#10442) Release Notes: - Extracted Scheme and Racket language support into extensions. --------- Co-authored-by: Marshall --- Cargo.lock | 20 ------------------- Cargo.toml | 1 - crates/extensions_ui/src/extension_suggest.rs | 2 ++ crates/languages/Cargo.toml | 2 -- crates/languages/src/lib.rs | 4 ---- extensions/racket/LICENSE-APACHE | 1 + extensions/racket/extension.toml | 11 ++++++++++ .../racket/languages}/racket/brackets.scm | 0 .../racket/languages}/racket/config.toml | 0 .../racket/languages}/racket/highlights.scm | 0 .../racket/languages}/racket/indents.scm | 0 .../racket/languages}/racket/outline.scm | 0 extensions/scheme/LICENSE-APACHE | 1 + extensions/scheme/extension.toml | 11 ++++++++++ .../scheme/languages}/scheme/brackets.scm | 0 .../scheme/languages}/scheme/config.toml | 0 .../scheme/languages}/scheme/highlights.scm | 0 .../scheme/languages}/scheme/indents.scm | 0 .../scheme/languages}/scheme/outline.scm | 0 .../scheme/languages}/scheme/overrides.scm | 0 20 files changed, 26 insertions(+), 27 deletions(-) create mode 120000 extensions/racket/LICENSE-APACHE create mode 100644 extensions/racket/extension.toml rename {crates/languages/src => extensions/racket/languages}/racket/brackets.scm (100%) rename {crates/languages/src => extensions/racket/languages}/racket/config.toml (100%) rename {crates/languages/src => extensions/racket/languages}/racket/highlights.scm (100%) rename {crates/languages/src => extensions/racket/languages}/racket/indents.scm (100%) rename {crates/languages/src => extensions/racket/languages}/racket/outline.scm (100%) create mode 120000 extensions/scheme/LICENSE-APACHE create mode 100644 extensions/scheme/extension.toml rename {crates/languages/src => extensions/scheme/languages}/scheme/brackets.scm (100%) rename {crates/languages/src => extensions/scheme/languages}/scheme/config.toml (100%) rename {crates/languages/src => extensions/scheme/languages}/scheme/highlights.scm (100%) rename {crates/languages/src => extensions/scheme/languages}/scheme/indents.scm (100%) rename {crates/languages/src => extensions/scheme/languages}/scheme/outline.scm (100%) rename {crates/languages/src => extensions/scheme/languages}/scheme/overrides.scm (100%) diff --git a/Cargo.lock b/Cargo.lock index ba0de249c6..4f0c154378 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5443,11 +5443,9 @@ dependencies = [ "tree-sitter-ocaml", "tree-sitter-proto", "tree-sitter-python", - "tree-sitter-racket", "tree-sitter-regex", "tree-sitter-ruby", "tree-sitter-rust", - "tree-sitter-scheme", "tree-sitter-typescript", "tree-sitter-vue", "tree-sitter-yaml", @@ -10468,15 +10466,6 @@ dependencies = [ "tree-sitter", ] -[[package]] -name = "tree-sitter-racket" -version = "0.0.1" -source = "git+https://github.com/zed-industries/tree-sitter-racket?rev=eb010cf2c674c6fd9a6316a84e28ef90190fe51a#eb010cf2c674c6fd9a6316a84e28ef90190fe51a" -dependencies = [ - "cc", - "tree-sitter", -] - [[package]] name = "tree-sitter-regex" version = "0.20.0" @@ -10507,15 +10496,6 @@ dependencies = [ "tree-sitter", ] -[[package]] -name = "tree-sitter-scheme" -version = "0.2.0" -source = "git+https://github.com/6cdh/tree-sitter-scheme?rev=af0fd1fa452cb2562dc7b5c8a8c55551c39273b9#af0fd1fa452cb2562dc7b5c8a8c55551c39273b9" -dependencies = [ - "cc", - "tree-sitter", -] - [[package]] name = "tree-sitter-typescript" version = "0.20.2" diff --git a/Cargo.toml b/Cargo.toml index d039591307..e8b03c0d96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -329,7 +329,6 @@ tree-sitter-nu = { git = "https://github.com/nushell/tree-sitter-nu", rev = "7dd tree-sitter-ocaml = { git = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "4abfdc1c7af2c6c77a370aee974627be1c285b3b" } tree-sitter-proto = { git = "https://github.com/rewinfrey/tree-sitter-proto", rev = "36d54f288aee112f13a67b550ad32634d0c2cb52" } tree-sitter-python = "0.20.2" -tree-sitter-racket = { git = "https://github.com/zed-industries/tree-sitter-racket", rev = "eb010cf2c674c6fd9a6316a84e28ef90190fe51a" } tree-sitter-regex = "0.20.0" tree-sitter-ruby = "0.20.0" tree-sitter-rust = "0.20.3" diff --git a/crates/extensions_ui/src/extension_suggest.rs b/crates/extensions_ui/src/extension_suggest.rs index df65e6ee31..cc9df0f2e9 100644 --- a/crates/extensions_ui/src/extension_suggest.rs +++ b/crates/extensions_ui/src/extension_suggest.rs @@ -52,7 +52,9 @@ const SUGGESTIONS_BY_EXTENSION_ID: &[(&str, &[&str])] = &[ ("prisma", &["prisma"]), ("purescript", &["purs"]), ("r", &["r", "R"]), + ("racket", &["rkt"]), ("sql", &["sql"]), + ("scheme", &["scm"]), ("svelte", &["svelte"]), ("swift", &["swift"]), ("templ", &["templ"]), diff --git a/crates/languages/Cargo.toml b/crates/languages/Cargo.toml index 046486c760..29913f424e 100644 --- a/crates/languages/Cargo.toml +++ b/crates/languages/Cargo.toml @@ -54,11 +54,9 @@ tree-sitter-nu.workspace = true tree-sitter-ocaml.workspace = true tree-sitter-proto.workspace = true tree-sitter-python.workspace = true -tree-sitter-racket.workspace = true tree-sitter-regex.workspace = true tree-sitter-ruby.workspace = true tree-sitter-rust.workspace = true -tree-sitter-scheme.workspace = true tree-sitter-typescript.workspace = true tree-sitter-vue.workspace = true tree-sitter-yaml.workspace = true diff --git a/crates/languages/src/lib.rs b/crates/languages/src/lib.rs index fbf27218fd..9a11a421d8 100644 --- a/crates/languages/src/lib.rs +++ b/crates/languages/src/lib.rs @@ -77,11 +77,9 @@ pub fn init( ), ("proto", tree_sitter_proto::language()), ("python", tree_sitter_python::language()), - ("racket", tree_sitter_racket::language()), ("regex", tree_sitter_regex::language()), ("ruby", tree_sitter_ruby::language()), ("rust", tree_sitter_rust::language()), - ("scheme", tree_sitter_scheme::language()), ("tsx", tree_sitter_typescript::language_tsx()), ("typescript", tree_sitter_typescript::language_typescript()), ("vue", tree_sitter_vue::language()), @@ -274,8 +272,6 @@ pub fn init( Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone())), ] ); - language!("scheme"); - language!("racket"); language!("regex"); language!( "yaml", diff --git a/extensions/racket/LICENSE-APACHE b/extensions/racket/LICENSE-APACHE new file mode 120000 index 0000000000..1cd601d0a3 --- /dev/null +++ b/extensions/racket/LICENSE-APACHE @@ -0,0 +1 @@ +../../LICENSE-APACHE \ No newline at end of file diff --git a/extensions/racket/extension.toml b/extensions/racket/extension.toml new file mode 100644 index 0000000000..8e59742685 --- /dev/null +++ b/extensions/racket/extension.toml @@ -0,0 +1,11 @@ +id = "racket" +name = "Racket" +description = "Racket support." +version = "0.0.1" +schema_version = 1 +authors = ["Mikayla Maki "] +repository = "https://github.com/zed-industries/zed" + +[grammars.racket] +repository = "https://github.com/zed-industries/tree-sitter-racket" +commit = "beb29de2b668110e69df0c6d51649c3e2c91d863" diff --git a/crates/languages/src/racket/brackets.scm b/extensions/racket/languages/racket/brackets.scm similarity index 100% rename from crates/languages/src/racket/brackets.scm rename to extensions/racket/languages/racket/brackets.scm diff --git a/crates/languages/src/racket/config.toml b/extensions/racket/languages/racket/config.toml similarity index 100% rename from crates/languages/src/racket/config.toml rename to extensions/racket/languages/racket/config.toml diff --git a/crates/languages/src/racket/highlights.scm b/extensions/racket/languages/racket/highlights.scm similarity index 100% rename from crates/languages/src/racket/highlights.scm rename to extensions/racket/languages/racket/highlights.scm diff --git a/crates/languages/src/racket/indents.scm b/extensions/racket/languages/racket/indents.scm similarity index 100% rename from crates/languages/src/racket/indents.scm rename to extensions/racket/languages/racket/indents.scm diff --git a/crates/languages/src/racket/outline.scm b/extensions/racket/languages/racket/outline.scm similarity index 100% rename from crates/languages/src/racket/outline.scm rename to extensions/racket/languages/racket/outline.scm diff --git a/extensions/scheme/LICENSE-APACHE b/extensions/scheme/LICENSE-APACHE new file mode 120000 index 0000000000..1cd601d0a3 --- /dev/null +++ b/extensions/scheme/LICENSE-APACHE @@ -0,0 +1 @@ +../../LICENSE-APACHE \ No newline at end of file diff --git a/extensions/scheme/extension.toml b/extensions/scheme/extension.toml new file mode 100644 index 0000000000..f7916ff783 --- /dev/null +++ b/extensions/scheme/extension.toml @@ -0,0 +1,11 @@ +id = "scheme" +name = "Scheme" +description = "Scheme support." +version = "0.0.1" +schema_version = 1 +authors = ["Mikayla Maki "] +repository = "https://github.com/zed-industries/zed" + +[grammars.scheme] +repository = "https://github.com/6cdh/tree-sitter-scheme" +commit = "af0fd1fa452cb2562dc7b5c8a8c55551c39273b9" diff --git a/crates/languages/src/scheme/brackets.scm b/extensions/scheme/languages/scheme/brackets.scm similarity index 100% rename from crates/languages/src/scheme/brackets.scm rename to extensions/scheme/languages/scheme/brackets.scm diff --git a/crates/languages/src/scheme/config.toml b/extensions/scheme/languages/scheme/config.toml similarity index 100% rename from crates/languages/src/scheme/config.toml rename to extensions/scheme/languages/scheme/config.toml diff --git a/crates/languages/src/scheme/highlights.scm b/extensions/scheme/languages/scheme/highlights.scm similarity index 100% rename from crates/languages/src/scheme/highlights.scm rename to extensions/scheme/languages/scheme/highlights.scm diff --git a/crates/languages/src/scheme/indents.scm b/extensions/scheme/languages/scheme/indents.scm similarity index 100% rename from crates/languages/src/scheme/indents.scm rename to extensions/scheme/languages/scheme/indents.scm diff --git a/crates/languages/src/scheme/outline.scm b/extensions/scheme/languages/scheme/outline.scm similarity index 100% rename from crates/languages/src/scheme/outline.scm rename to extensions/scheme/languages/scheme/outline.scm diff --git a/crates/languages/src/scheme/overrides.scm b/extensions/scheme/languages/scheme/overrides.scm similarity index 100% rename from crates/languages/src/scheme/overrides.scm rename to extensions/scheme/languages/scheme/overrides.scm