docs: Add gopls install instructions (#18919)
This commit is contained in:
parent
bc4abd2b29
commit
bc23d1e666
1 changed files with 31 additions and 0 deletions
|
@ -5,6 +5,37 @@ Go support is available natively in Zed.
|
||||||
- Tree Sitter: [tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go)
|
- Tree Sitter: [tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go)
|
||||||
- Language Server: [golang/tools/tree/master/gopls](https://github.com/golang/tools/tree/master/gopls)
|
- Language Server: [golang/tools/tree/master/gopls](https://github.com/golang/tools/tree/master/gopls)
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
We recommend installing gopls via go's package manager and not via Homebrew or your Linux distribution's package manager.
|
||||||
|
|
||||||
|
1. Make sure you have uninstalled any version of gopls you have installed via your package manager:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# MacOS homebrew
|
||||||
|
brew remove gopls
|
||||||
|
# Ubuntu
|
||||||
|
sudo apt-get remove gopls
|
||||||
|
sudo snap remove gopls
|
||||||
|
# Arch
|
||||||
|
sudo pacman -R gopls
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install/Update `gopls` to the latest version using the go module tool:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go install golang.org/x/tools/gopls@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Ensure that `gopls` is in your path:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
which gopls
|
||||||
|
gopls version
|
||||||
|
```
|
||||||
|
|
||||||
|
If `gopls` is not found you will likely need to add `export PATH="$PATH:$HOME/go/bin"` to your `.zshrc` / `.bash_profile`
|
||||||
|
|
||||||
## Inlay Hints
|
## Inlay Hints
|
||||||
|
|
||||||
Zed sets the following initialization options for inlay hints:
|
Zed sets the following initialization options for inlay hints:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue