Gopls:使用 Zed
安裝 gopls
要將 gopls
與 Zed 結合使用,請先安裝 gopls
可執行檔案,並確保包含生成二進位制檔案的目錄(即 $(go env GOBIN)
或 $(go env GOPATH)/bin
)已新增到您的 PATH
中。
就是這樣
Zed 內建了 LSP 客戶端,並且知道在訪問 Go 原始檔時執行 gopls
,因此大多數功能都可以開箱即用。
Zed 尚不支援外部 window/showDocument
請求,因此基於 Web 的功能將無法使用;請參閱 Zed issue 24852。
本文件的原始碼可以在 golang.org/x/tools/gopls/doc 下找到。