mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-08-17 03:50:21 +03:00
feat(lang): add go.mod and go.work support (#2197)
This commit is contained in:
parent
8d335f63f0
commit
4144c9d2f2
@ -24,6 +24,8 @@
|
||||
| gleam | ✓ | | | |
|
||||
| glsl | ✓ | | ✓ | |
|
||||
| go | ✓ | ✓ | ✓ | `gopls` |
|
||||
| gomod | ✓ | | | `gopls` |
|
||||
| gowork | ✓ | | | `gopls` |
|
||||
| graphql | ✓ | | | |
|
||||
| haskell | ✓ | | | `haskell-language-server-wrapper` |
|
||||
| hcl | ✓ | | ✓ | `terraform-ls` |
|
||||
|
@ -268,6 +268,36 @@ args = { mode = "local", processId = "{0}" }
|
||||
name = "go"
|
||||
source = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "0fa917a7022d1cd2e9b779a6a8fc5dc7fad69c75" }
|
||||
|
||||
[[language]]
|
||||
name = "gomod"
|
||||
scope = "source.gomod"
|
||||
injection-regex = "gomod"
|
||||
file-types = ["go.mod"]
|
||||
roots = []
|
||||
auto-format = true
|
||||
comment-token = "//"
|
||||
language-server = { command = "gopls" }
|
||||
indent = { tab-width = 4, unit = "\t" }
|
||||
|
||||
[[grammar]]
|
||||
name = "gomod"
|
||||
source = { git = "https://github.com/camdencheek/tree-sitter-go-mod", rev = "e8f51f8e4363a3d9a427e8f63f4c1bbc5ef5d8d0" }
|
||||
|
||||
[[language]]
|
||||
name = "gowork"
|
||||
scope = "source.gowork"
|
||||
injection-regex = "gowork"
|
||||
file-types = ["go.work"]
|
||||
roots = []
|
||||
auto-format = true
|
||||
comment-token = "//"
|
||||
language-server = { command = "gopls" }
|
||||
indent = { tab-width = 4, unit = "\t" }
|
||||
|
||||
[[grammar]]
|
||||
name = "gowork"
|
||||
source = { git = "https://github.com/omertuc/tree-sitter-go-work", rev = "6dd9dd79fb51e9f2abc829d5e97b15015b6a8ae2" }
|
||||
|
||||
[[language]]
|
||||
name = "javascript"
|
||||
scope = "source.js"
|
||||
@ -998,7 +1028,7 @@ file-types = ["kt", "kts"]
|
||||
roots = ["settings.gradle", "settings.gradle.kts"]
|
||||
comment-token = "//"
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
language-server = { command = "kotlin-language-server" }
|
||||
language-server = { command = "kotlin-language-server" }
|
||||
|
||||
[[grammar]]
|
||||
name = "kotlin"
|
||||
|
17
runtime/queries/gomod/highlights.scm
Normal file
17
runtime/queries/gomod/highlights.scm
Normal file
@ -0,0 +1,17 @@
|
||||
[
|
||||
"require"
|
||||
"replace"
|
||||
"go"
|
||||
"exclude"
|
||||
"retract"
|
||||
"module"
|
||||
] @keyword
|
||||
|
||||
"=>" @operator
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(version)
|
||||
(go_version)
|
||||
] @string
|
2
runtime/queries/gomod/injections.scm
Normal file
2
runtime/queries/gomod/injections.scm
Normal file
@ -0,0 +1,2 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
14
runtime/queries/gowork/highlights.scm
Normal file
14
runtime/queries/gowork/highlights.scm
Normal file
@ -0,0 +1,14 @@
|
||||
[
|
||||
"replace"
|
||||
"go"
|
||||
"use"
|
||||
] @keyword
|
||||
|
||||
"=>" @operator
|
||||
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(version)
|
||||
(go_version)
|
||||
] @string
|
2
runtime/queries/gowork/injections.scm
Normal file
2
runtime/queries/gowork/injections.scm
Normal file
@ -0,0 +1,2 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
Loading…
Reference in New Issue
Block a user