diff --git a/Cargo.lock b/Cargo.lock index 0a6d44fc35..cacc3cb91e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8828,6 +8828,15 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "tree-sitter-gowork" +version = "0.0.1" +source = "git+https://github.com/d1y/tree-sitter-go-work#a2a4b99b53b3740855ff33f0b54cab0bb4ce6f45" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "tree-sitter-haskell" version = "0.14.0" @@ -10357,6 +10366,7 @@ dependencies = [ "tree-sitter-glsl", "tree-sitter-go", "tree-sitter-gomod", + "tree-sitter-gowork", "tree-sitter-haskell", "tree-sitter-heex", "tree-sitter-html", diff --git a/Cargo.toml b/Cargo.toml index d312c27abd..a954995ac2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -145,6 +145,7 @@ tree-sitter-gleam = { git = "https://github.com/gleam-lang/tree-sitter-gleam", r 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" } tree-sitter-haskell = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "cf98de23e4285b8e6bcb57b050ef2326e2cc284b" } tree-sitter-heex = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "2e1348c3cf2c9323e87c2744796cf3f3868aa82a" } tree-sitter-html = "0.19.0" diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 0b73a44919..d668aa30c6 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -118,6 +118,7 @@ tree-sitter-gleam.workspace = true tree-sitter-glsl.workspace = true tree-sitter-go.workspace = true tree-sitter-gomod.workspace = true +tree-sitter-gowork.workspace = true tree-sitter-haskell.workspace = true tree-sitter-heex.workspace = true tree-sitter-html.workspace = true diff --git a/crates/zed/src/languages.rs b/crates/zed/src/languages.rs index 8fcb27a5ce..64bec543c2 100644 --- a/crates/zed/src/languages.rs +++ b/crates/zed/src/languages.rs @@ -124,6 +124,7 @@ pub fn init( vec![Arc::new(go::GoLspAdapter)], ); language("gomod", tree_sitter_gomod::language(), vec![]); + language("gowork", tree_sitter_gowork::language(), vec![]); language( "zig", tree_sitter_zig::language(), diff --git a/crates/zed/src/languages/gowork/config.toml b/crates/zed/src/languages/gowork/config.toml new file mode 100644 index 0000000000..919f1db512 --- /dev/null +++ b/crates/zed/src/languages/gowork/config.toml @@ -0,0 +1,7 @@ +name = "Go Work" +path_suffixes = ["work"] +line_comments = ["//"] +autoclose_before = ")" +brackets = [ + { start = "(", end = ")", close = true, newline = true} +] diff --git a/crates/zed/src/languages/gowork/highlights.scm b/crates/zed/src/languages/gowork/highlights.scm new file mode 100644 index 0000000000..9c84bcc449 --- /dev/null +++ b/crates/zed/src/languages/gowork/highlights.scm @@ -0,0 +1,14 @@ +[ + "replace" + "go" + "use" +] @keyword + +"=>" @operator + +(comment) @comment + +[ +(version) +(go_version) +] @string