diff --git a/Cargo.lock b/Cargo.lock index dd37b6a626..cc8d89cec3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16324,13 +16324,6 @@ dependencies = [ "serde", ] -[[package]] -name = "zed_clojure" -version = "0.0.3" -dependencies = [ - "zed_extension_api 0.1.0", -] - [[package]] name = "zed_csharp" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index a08cd8efa9..e0ccdc716b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -149,7 +149,6 @@ members = [ # Extensions # - "extensions/clojure", "extensions/csharp", "extensions/deno", "extensions/elixir", diff --git a/docs/src/languages/clojure.md b/docs/src/languages/clojure.md index 85042618a5..3e3ddd8e1f 100644 --- a/docs/src/languages/clojure.md +++ b/docs/src/languages/clojure.md @@ -1,6 +1,6 @@ # Clojure -Clojure support is available through the [Clojure extension](https://github.com/zed-industries/zed/tree/main/extensions/clojure). +Clojure support is available through the [Clojure extension](https://github.com/zed-extensions/clojure). - Tree Sitter: [prcastro/tree-sitter-clojure](https://github.com/prcastro/tree-sitter-clojure) - Language Server: [clojure-lsp/clojure-lsp](https://github.com/clojure-lsp/clojure-lsp) diff --git a/extensions/clojure/Cargo.toml b/extensions/clojure/Cargo.toml deleted file mode 100644 index 4fa4aaee99..0000000000 --- a/extensions/clojure/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "zed_clojure" -version = "0.0.3" -edition = "2021" -publish = false -license = "Apache-2.0" - -[lints] -workspace = true - -[lib] -path = "src/clojure.rs" -crate-type = ["cdylib"] - -[dependencies] -zed_extension_api = "0.1.0" diff --git a/extensions/clojure/LICENSE-APACHE b/extensions/clojure/LICENSE-APACHE deleted file mode 120000 index 1cd601d0a3..0000000000 --- a/extensions/clojure/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE-APACHE \ No newline at end of file diff --git a/extensions/clojure/extension.toml b/extensions/clojure/extension.toml deleted file mode 100644 index fc4d9548fe..0000000000 --- a/extensions/clojure/extension.toml +++ /dev/null @@ -1,15 +0,0 @@ -id = "clojure" -name = "Clojure" -description = "Clojure support." -version = "0.0.3" -schema_version = 1 -authors = ["Paulo Roberto de Oliveira Castro "] -repository = "https://github.com/zed-industries/zed" - -[language_servers.clojure-lsp] -name = "clojure-lsp" -language = "Clojure" - -[grammars.clojure] -repository = "https://github.com/prcastro/tree-sitter-clojure" -commit = "38b4f8d264248b2fd09575fbce66f7c22e8929d5" diff --git a/extensions/clojure/languages/clojure/brackets.scm b/extensions/clojure/languages/clojure/brackets.scm deleted file mode 100644 index 191fd9c084..0000000000 --- a/extensions/clojure/languages/clojure/brackets.scm +++ /dev/null @@ -1,3 +0,0 @@ -("(" @open ")" @close) -("[" @open "]" @close) -("{" @open "}" @close) diff --git a/extensions/clojure/languages/clojure/config.toml b/extensions/clojure/languages/clojure/config.toml deleted file mode 100644 index 998335e748..0000000000 --- a/extensions/clojure/languages/clojure/config.toml +++ /dev/null @@ -1,12 +0,0 @@ -name = "Clojure" -grammar = "clojure" -path_suffixes = ["clj", "cljs", "cljc", "cljd", "edn", "bb"] -line_comments = [";; "] -autoclose_before = "}])" -brackets = [ - { start = "{", end = "}", close = true, newline = true }, - { start = "[", end = "]", close = true, newline = true }, - { start = "(", end = ")", close = true, newline = true }, - { start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] }, -] -word_characters = ["-"] diff --git a/extensions/clojure/languages/clojure/highlights.scm b/extensions/clojure/languages/clojure/highlights.scm deleted file mode 100644 index f4abe3bcdd..0000000000 --- a/extensions/clojure/languages/clojure/highlights.scm +++ /dev/null @@ -1,41 +0,0 @@ -;; Literals - -(num_lit) @number - -[ - (char_lit) - (str_lit) -] @string - -[ - (bool_lit) - (nil_lit) -] @constant.builtin - -(kwd_lit) @constant - -;; Comments - -(comment) @comment - -;; Treat quasiquotation as operators for the purpose of highlighting. - -[ - "'" - "`" - "~" - "@" - "~@" -] @operator - - -(list_lit - . - (sym_lit) @function) - -(list_lit - . - (sym_lit) @keyword - (#match? @keyword - "^(do|if|let|var|fn|fn*|loop*|recur|throw|try|catch|finally|set!|new|quote|->|->>)$" - )) diff --git a/extensions/clojure/languages/clojure/indents.scm b/extensions/clojure/languages/clojure/indents.scm deleted file mode 100644 index 9a1cbad161..0000000000 --- a/extensions/clojure/languages/clojure/indents.scm +++ /dev/null @@ -1,3 +0,0 @@ -(_ "[" "]") @indent -(_ "{" "}") @indent -(_ "(" ")") @indent diff --git a/extensions/clojure/languages/clojure/outline.scm b/extensions/clojure/languages/clojure/outline.scm deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/extensions/clojure/src/clojure.rs b/extensions/clojure/src/clojure.rs deleted file mode 100644 index 4804f2e78a..0000000000 --- a/extensions/clojure/src/clojure.rs +++ /dev/null @@ -1,109 +0,0 @@ -use std::fs; -use zed_extension_api::{self as zed, LanguageServerId, Result}; - -struct ClojureExtension { - cached_binary_path: Option, -} - -impl ClojureExtension { - fn language_server_binary_path( - &mut self, - language_server_id: &LanguageServerId, - worktree: &zed::Worktree, - ) -> Result { - if let Some(path) = worktree.which("clojure-lsp") { - return Ok(path); - } - - if let Some(path) = &self.cached_binary_path { - if fs::metadata(path).map_or(false, |stat| stat.is_file()) { - return Ok(path.clone()); - } - } - - zed::set_language_server_installation_status( - language_server_id, - &zed::LanguageServerInstallationStatus::CheckingForUpdate, - ); - let release = zed::latest_github_release( - "clojure-lsp/clojure-lsp", - zed::GithubReleaseOptions { - require_assets: true, - pre_release: false, - }, - )?; - - let (platform, arch) = zed::current_platform(); - let asset_name = format!( - "clojure-lsp-native-{os}-{arch}.zip", - os = match platform { - zed::Os::Mac => "macos", - zed::Os::Linux => "linux", - zed::Os::Windows => "windows", - }, - arch = match arch { - zed::Architecture::Aarch64 => "aarch64", - zed::Architecture::X8664 => "amd64", - zed::Architecture::X86 => - return Err(format!("unsupported architecture: {arch:?}")), - }, - ); - - let asset = release - .assets - .iter() - .find(|asset| asset.name == asset_name) - .ok_or_else(|| format!("no asset found matching {:?}", asset_name))?; - - let version_dir = format!("clojure-lsp-{}", release.version); - let binary_path = format!("{version_dir}/clojure-lsp"); - - if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) { - zed::set_language_server_installation_status( - language_server_id, - &zed::LanguageServerInstallationStatus::Downloading, - ); - - zed::download_file( - &asset.download_url, - &version_dir, - zed::DownloadedFileType::Zip, - ) - .map_err(|e| format!("failed to download file: {e}"))?; - - let entries = - fs::read_dir(".").map_err(|e| format!("failed to list working directory {e}"))?; - for entry in entries { - let entry = entry.map_err(|e| format!("failed to load directory entry {e}"))?; - if entry.file_name().to_str() != Some(&version_dir) { - fs::remove_dir_all(entry.path()).ok(); - } - } - } - - self.cached_binary_path = Some(binary_path.clone()); - Ok(binary_path) - } -} - -impl zed::Extension for ClojureExtension { - fn new() -> Self { - Self { - cached_binary_path: None, - } - } - - fn language_server_command( - &mut self, - language_server_id: &LanguageServerId, - worktree: &zed::Worktree, - ) -> Result { - Ok(zed::Command { - command: self.language_server_binary_path(language_server_id, worktree)?, - args: Vec::new(), - env: Default::default(), - }) - } -} - -zed::register_extension!(ClojureExtension); diff --git a/typos.toml b/typos.toml index a1788fff5e..6e4cb4a7b8 100644 --- a/typos.toml +++ b/typos.toml @@ -28,8 +28,6 @@ extend-exclude = [ # Editor and file finder rely on partial typing and custom in-string syntax. "crates/file_finder/src/file_finder_tests.rs", "crates/editor/src/editor_tests.rs", - # Clojure uses .edn filename extension, which is not a misspelling of "end". - "extensions/clojure/languages/clojure/config.toml", # There are some names in the test data that are incorrectly flagged as typos. "crates/git/test_data/blame_incremental_complex", "crates/git/test_data/golden/blame_incremental_complex.json",