Add highlighting for go.work (#7142)

<img width="617" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/ecb28152-db02-450e-bc81-395abd1c1eef">

Release Notes:

- Added  highlighting for go.work
This commit is contained in:
d1y 2024-02-01 03:11:03 +08:00 committed by GitHub
parent ebdabb907a
commit 5d85801d1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 34 additions and 0 deletions

10
Cargo.lock generated
View File

@ -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",

View File

@ -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"

View File

@ -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

View File

@ -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(),

View File

@ -0,0 +1,7 @@
name = "Go Work"
path_suffixes = ["work"]
line_comments = ["//"]
autoclose_before = ")"
brackets = [
{ start = "(", end = ")", close = true, newline = true}
]

View File

@ -0,0 +1,14 @@
[
"replace"
"go"
"use"
] @keyword
"=>" @operator
(comment) @comment
[
(version)
(go_version)
] @string