Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
haskell: Extract to zed-extensions/haskell repository (#26306)
Marshall Bowers4f6682c7fe5b
diff --git a/Cargo.lock b/Cargo.lockindex f31f51ee71d..acec73fa6ba 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -17072,13 +17072,6 @@ dependencies = ["zed_extension_api 0.1.0",]-[[package]]-name = "zed_haskell"-version = "0.1.3"-dependencies = [- "zed_extension_api 0.1.0",-]-[[package]]name = "zed_html"version = "0.1.6"diff --git a/Cargo.toml b/Cargo.tomlindex 5cb40db6ade..8c18627262c 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -171,7 +171,6 @@ members = ["extensions/emmet","extensions/glsl",- "extensions/haskell","extensions/html","extensions/perplexity","extensions/proto",diff --git a/docs/src/languages/haskell.md b/docs/src/languages/haskell.mdindex 7e87345018b..738b6f39f4f 100644--- a/docs/src/languages/haskell.md+++ b/docs/src/languages/haskell.md@@ -1,6 +1,6 @@# Haskell-Haskell support is available through the [Haskell extension](https://github.com/zed-industries/zed/tree/main/extensions/haskell).+Haskell support is available through the [Haskell extension](https://github.com/zed-extensions/haskell).- Tree-sitter: [tree-sitter-haskell](https://github.com/tree-sitter/tree-sitter-haskell)- Language Server: [haskell-language-server](https://github.com/haskell/haskell-language-server)diff --git a/extensions/haskell/Cargo.toml b/extensions/haskell/Cargo.tomldeleted file mode 100644index e32801cd9a3..00000000000--- a/extensions/haskell/Cargo.toml+++ /dev/null@@ -1,16 +0,0 @@-[package]-name = "zed_haskell"-version = "0.1.3"-edition.workspace = true-publish.workspace = true-license = "Apache-2.0"--[lints]-workspace = true--[lib]-path = "src/haskell.rs"-crate-type = ["cdylib"]--[dependencies]-zed_extension_api = "0.1.0"diff --git a/extensions/haskell/LICENSE-APACHE b/extensions/haskell/LICENSE-APACHEdeleted file mode 120000index 1cd601d0a3a..00000000000--- a/extensions/haskell/LICENSE-APACHE+++ /dev/null@@ -1 +0,0 @@-../../LICENSE-APACHE\ No newline at end of filediff --git a/extensions/haskell/extension.toml b/extensions/haskell/extension.tomldeleted file mode 100644index b8079bb96dc..00000000000--- a/extensions/haskell/extension.toml+++ /dev/null@@ -1,18 +0,0 @@-id = "haskell"-name = "Haskell"-description = "Haskell support."-version = "0.1.3"-schema_version = 1-authors = [- "Pocæus <[email protected]>",- "Lei <[email protected]>"-]-repository = "https://github.com/zed-industries/zed"--[language_servers.hls]-name = "Haskell Language Server"-language = "Haskell"--[grammars.haskell]-repository = "https://github.com/tree-sitter/tree-sitter-haskell"-commit = "8a99848fc734f9c4ea523b3f2a07df133cbbcec2"diff --git a/extensions/haskell/languages/haskell/brackets.scm b/extensions/haskell/languages/haskell/brackets.scmdeleted file mode 100644index 191fd9c084a..00000000000--- a/extensions/haskell/languages/haskell/brackets.scm+++ /dev/null@@ -1,3 +0,0 @@-("(" @open ")" @close)-("[" @open "]" @close)-("{" @open "}" @close)diff --git a/extensions/haskell/languages/haskell/config.toml b/extensions/haskell/languages/haskell/config.tomldeleted file mode 100644index 3d83ab907de..00000000000--- a/extensions/haskell/languages/haskell/config.toml+++ /dev/null@@ -1,14 +0,0 @@-name = "Haskell"-grammar = "haskell"-path_suffixes = ["hs"]-autoclose_before = ",=)}]"-line_comments = ["-- "]-block_comment = ["{- ", " -}"]-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 },- { start = "'", end = "'", close = true, newline = false },- { start = "`", end = "`", close = true, newline = false },-]diff --git a/extensions/haskell/languages/haskell/highlights.scm b/extensions/haskell/languages/haskell/highlights.scmdeleted file mode 100644index 3ffc6512b8f..00000000000--- a/extensions/haskell/languages/haskell/highlights.scm+++ /dev/null@@ -1,156 +0,0 @@-;; Copyright 2022 nvim-treesitter-;;-;; Licensed under the Apache License, Version 2.0 (the "License");-;; you may not use this file except in compliance with the License.-;; You may obtain a copy of the License at-;;-;; http://www.apache.org/licenses/LICENSE-2.0-;;-;; Unless required by applicable law or agreed to in writing, software-;; distributed under the License is distributed on an "AS IS" BASIS,-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-;; See the License for the specific language governing permissions and-;; limitations under the License.--;; -----------------------------------------------------------------------------;; Literals and comments--(integer) @number-(exp_negation) @number-(exp_literal (float)) @float-(char) @string-(string) @string--(con_unit) @symbol ; unit, as in ()--(comment) @comment---;; -----------------------------------------------------------------------------;; Punctuation--[- "("- ")"- "{"- "}"- "["- "]"-] @punctuation.bracket--[- (comma)- ";"-] @punctuation.delimiter---;; -----------------------------------------------------------------------------;; Keywords, operators, includes--[- "forall"- "∀"-] @keyword--(pragma) @constant--[- "if"- "then"- "else"- "case"- "of"-] @keyword--(exp_lambda_cases "\\" ("cases" @variant))--[- "import"- "qualified"- "module"-] @keyword--[- (operator)- (constructor_operator)- (type_operator)- (tycon_arrow)- (qualified_module) ; grabs the `.` (dot), ex: import System.IO- (all_names)- (wildcard)- "="- "|"- "::"- "=>"- "->"- "<-"- "\\"- "`"- "@"-] @operator--(module) @title--[- (where)- "let"- "in"- "class"- "instance"- "data"- "newtype"- "family"- "type"- "as"- "hiding"- "deriving"- "via"- "stock"- "anyclass"- "do"- "mdo"- "rec"- "infix"- "infixl"- "infixr"-] @keyword---;; -----------------------------------------------------------------------------;; Functions and variables--(variable) @variable-(pat_wildcard) @variable--(signature name: (variable) @type)-(function- name: (variable) @function- patterns: (patterns))-((signature (fun)) . (function (variable) @function))-((signature (context (fun))) . (function (variable) @function))-((signature (forall (context (fun)))) . (function (variable) @function))--(exp_infix (variable) @operator) ; consider infix functions as operators--(exp_infix (exp_name) @function (#set! "priority" 101))-(exp_apply . (exp_name (variable) @function))-(exp_apply . (exp_name (qualified_variable (variable) @function)))---;; -----------------------------------------------------------------------------;; Types--(type) @type-(type_variable) @type--(constructor) @constructor--; True or False-((constructor) @_bool (#match? @_bool "(True|False)")) @boolean---;; -----------------------------------------------------------------------------;; Quasi-quotes--(quoter) @function-; Highlighting of quasiquote_body is handled by injections.scmdiff --git a/extensions/haskell/languages/haskell/indents.scm b/extensions/haskell/languages/haskell/indents.scmdeleted file mode 100644index 112b414aa45..00000000000--- a/extensions/haskell/languages/haskell/indents.scm+++ /dev/null@@ -1,3 +0,0 @@-(_ "[" "]" @end) @indent-(_ "{" "}" @end) @indent-(_ "(" ")" @end) @indentdiff --git a/extensions/haskell/languages/haskell/outline.scm b/extensions/haskell/languages/haskell/outline.scmdeleted file mode 100644index db744eca6d5..00000000000--- a/extensions/haskell/languages/haskell/outline.scm+++ /dev/null@@ -1,26 +0,0 @@-(adt- "data" @context- name: (type) @name) @item--(type_alias- "type" @context- name: (type) @name) @item--(newtype- "newtype" @context- name: (type) @name) @item--(signature- name: (variable) @name) @item--(class- "class" @context- (class_head) @name) @item--(instance- "instance" @context- (instance_head) @name) @item--(foreign_import- "foreign" @context- (impent) @name) @itemdiff --git a/extensions/haskell/languages/haskell/textobjects.scm b/extensions/haskell/languages/haskell/textobjects.scmdeleted file mode 100644index 43023974670..00000000000--- a/extensions/haskell/languages/haskell/textobjects.scm+++ /dev/null@@ -1,12 +0,0 @@-(comment)+ @comment.around--[- (adt)- (type_alias)- (newtype)-] @class.around--(record_fields "{" (_)* @class.inside "}")--((signature)? (function)+) @function.around-(function rhs:(_) @function.inside)diff --git a/extensions/haskell/src/haskell.rs b/extensions/haskell/src/haskell.rsdeleted file mode 100644index 2691a0d3330..00000000000--- a/extensions/haskell/src/haskell.rs+++ /dev/null@@ -1,67 +0,0 @@-use zed::lsp::{Symbol, SymbolKind};-use zed::{CodeLabel, CodeLabelSpan};-use zed_extension_api::{self as zed, Result};--struct HaskellExtension;--impl zed::Extension for HaskellExtension {- fn new() -> Self {- Self- }-- fn language_server_command(- &mut self,- _language_server_id: &zed::LanguageServerId,- worktree: &zed::Worktree,- ) -> Result<zed::Command> {- let path = worktree- .which("haskell-language-server-wrapper")- .ok_or_else(|| "hls must be installed via ghcup".to_string())?;-- Ok(zed::Command {- command: path,- args: vec!["lsp".to_string()],- env: worktree.shell_env(),- })- }-- fn label_for_symbol(- &self,- _language_server_id: &zed::LanguageServerId,- symbol: Symbol,- ) -> Option<CodeLabel> {- let name = &symbol.name;-- let (code, display_range, filter_range) = match symbol.kind {- SymbolKind::Struct => {- let data_decl = "data ";- let code = format!("{data_decl}{name} = A");- let display_range = 0..data_decl.len() + name.len();- let filter_range = data_decl.len()..display_range.end;- (code, display_range, filter_range)- }- SymbolKind::Constructor => {- let data_decl = "data A = ";- let code = format!("{data_decl}{name}");- let display_range = data_decl.len()..data_decl.len() + name.len();- let filter_range = 0..name.len();- (code, display_range, filter_range)- }- SymbolKind::Variable => {- let code = format!("{name} :: T");- let display_range = 0..name.len();- let filter_range = 0..name.len();- (code, display_range, filter_range)- }- _ => return None,- };-- Some(CodeLabel {- spans: vec![CodeLabelSpan::code_range(display_range)],- filter_range: filter_range.into(),- code,- })- }-}--zed::register_extension!(HaskellExtension);