x/tools/gopls: working with the go2go generics prototype #39619
Milestone
Comments
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this issue
Jul 31, 2020
0.4.3 Disable the fillstruct analysis by default. We recently uncovered some performance issues with the analysis, leading us to disable it by default. Once those issues are resolved, we will enable it by default again. You can still enable it by adding the following to your VS Code settings: "gopls": { "analyses": { "fillstruct": true, } } gopls/v0.4.2 Significant memory improvements (@heschik). Dependency test variants and vendored packages are no longer considered "workspace packages". Smart autocompletion for "append" (@muirdm). A "fill struct" code action to suggest populating a struct literal with default values (@luciolas, @joshbaum). Better cgo support with Go 1.15 (@heschik). Learn more: golang/go#35721 (comment). Code lens to run Go tests directly in the editor (@martskins). Currently opt-in: "gopls": { "codelens": { "test": true, } } Improved folding in composite literals (@joshbaum). Pop-up suggestion to run go mod vendor when inconsistent vendoring detected (@stamblerre). Respect GOPRIVATE for all document links and links on hover (@findleyr). A full list of issues resolved in this release can be found in the gopls/v0.4.2 milestone. gopls/dev.go2go: You can use the new go2go prototype with gopls. See golang/go#39619.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: