Open xanderim opened 1 month ago
Fixed in #4
thanks @weastur, I've tried following the steps in your commit but I have the same problem
@xanderim Unfortunately, there are also at lease two issues, which I fixed in #3 and #6. As a quick workaround you can:
golangci-lint-langserver
manually (for example, on macOS this could be done with brew install golangci-lint-langserver
)$HOME/Library/Application\ Support/Zed/extensions/
, I'm not sure about other OS'sextensions->golangci-lint->manifest->language_servers->golangci-lint->languages
, and make the array equal to `["Go"]. So you get something like this
{
"extensions": {
"golangci-lint": {
"manifest": {
"id": "golangci-lint",
"name": "Golangci-Lint",
"version": "0.1.0",
"schema_version": 1,
"description": "Golangci Lint support.",
"repository": "https://github.com/j4ng5y/zed_golangci_lint",
"authors": [
"Jordan Gregory <jordan@j4ng5y.dev>"
],
"lib": {
"kind": "Rust",
"version": null
},
"themes": [],
"languages": [],
"grammars": {},
"language_servers": {
"golangci-lint": {
"language": "Golangci Lint",
"languages": ["Go"],
"language_ids": {},
"code_action_kinds": null
}
},
"slash_commands": {},
"indexed_docs_providers": {},
"snippets": null
},
..............
But this file might be rewritten by Zed on any extension update/install etc.
Even with the above changes, I get the same error. I am on linux, not a mac though
1.
❯ which golangci-lint-langserver
/home/justin/go/bin/golangci-lint-langserver
2.
"lsp": {
"zls": {
"binary": {
"path": "/home/justin/.local/bin/zls"
}
},
"golangci-lint": {
"initialization_options": {
"command": [
"golangci-lint",
"run",
"--enable-all",
"--disable",
"lll",
"--out-format",
"json",
"--issues-exit-code=1"
]
}
}
},
"languages": {
"Go": {
"language_servers": ["gopls", "golangci-lint"]
}
}
id = "golangci-lint"
name = "Golangci-Lint"
description = "Golangci Lint support."
version = "0.1.0"
schema_version = 1
authors = ["Jordan Gregory <jordan@j4ng5y.dev>"]
repository = "https://github.com/j4ng5y/zed_golangci_lint"
[language_servers.golangci-lint]
name = "golangci-lint"
language = "Golangci Lint"
languages = ["Go"]
2024-08-27T21:11:54.55481555-04:00 [WARN] no language server found matching 'golangci-lint'
2024-08-27T21:11:54.55488198-04:00 [INFO] starting language servers for Go: gopls
Even with the above changes, I get the same error. I am on linux, not a mac though
I was able to get it running by doing the fix above and manually replacing extension.wasm from the repository. They are quite different (188KB vs 499KB). I guess that's tied to #6.
Even copying down his extension.wasm, the result is the same.
2024-08-28T22:37:29.809873837-04:00 [WARN] no language server found matching 'golangci-lint'
2024-08-28T22:37:29.809884908-04:00 [INFO] starting language servers for Go: gopls
2024-08-28T22:37:29.809898603-04:00 [WARN] no language server found matching 'golangci-lint'
@jseiser $HOME/Library/Application\ Support/Zed/extensions/installed/golangci-lint/extension.toml
...
[language_servers.golangci-lint]
language = "Golangci Lint"
languages = ["Go"] // change this line
...
Ya, its correct for me, but it still doesnt run. I assume its a Mac/Linux thing at this point?
❯ cat ~/.local/share/zed/extensions/installed/golangci-lint/extension.toml
id = "golangci-lint"
name = "Golangci-Lint"
version = "0.1.0"
schema_version = 1
description = "Golangci Lint support."
repository = "https://github.com/j4ng5y/zed_golangci_lint"
authors = ["Jordan Gregory <jordan@j4ng5y.dev>"]
themes = []
languages = ["Go"]
[lib]
kind = "Rust"
version = "0.0.6"
[grammars]
[language_servers.golangci-lint]
name = "golangci-lint"
language = "Golangci Lint"
languages = ["Go"]
[language_servers.golangci-lint.language_ids]
[slash_commands]
@jseiser
Hi @j4ng5y, thanks for the extension. From my understanding this extension launches "golangci-lint-langserver" so Zed can utilize it for linting. Unfortunately, due to my limited knowledge I couldn't make it work. Can you please give a quick look and point me into the right direction? Thanks.