x/tools/gopls: working with the go2go generics prototype #39619
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Thinking
Tools
This label describes issues relating to any tools in the x/tools repository.
For full context, see https://blog.golang.org/generics-next-step.
gopls
can be made to work with the generics prototype. It will work with any editor that recognizes.go2
as a Go file extension.As of 06/16/2020, the only way to do this is by installing a special version of the VS Code Go extension. This issue will be updated as other editors begin to support this.
Follow these instructions to build and use
gopls
with thedev.go2go
branch of Go.Build
go
First, build Go at this branch from source:
Make sure that this version of
go
is first on your PATH. Confirm by runninggo version
.Next, using that version of
go
, install the dev.go2go-compatible version ofgopls
:Build
gopls
Install a go2-version of the VS Code Go extension
The final step will be to configure your editor to recognize
.go2
files. You can do this by installing a special version of the VS Code Go extension that can translate between.go
and.go2
files.This extension is distributed as a
.vsix
file and can be found in the dev.go2go VS Code Go release. Downloadgo-nightly-0.0.0.vsix
and manually install the extension by following these steps:go-nightly-0.0.0.vsix
. Alternatively, you can run code --install-extension path/to/go.vsix or open the Command Palette and run the Extensions: Install from VSIX... command.Troubleshooting
If it's not working, make sure that your version of Go in VS Code is the dev.go2go version you built.
You can check the version in the
gopls (server)
output logs (View: Toggle Output -> Tasks -> gopls (server)).You can also explicitly specify the path to the
go version
in yoursettings.json
file:The text was updated successfully, but these errors were encountered: