Closed bitfield closed 5 years ago
@marco-m: The follow-up to this was in https://github.com/golang/go/issues/32142, which was ultimately closed as working as intended. If you are experiencing a problem with gopls
, please file a separate issue with information about your environment and logs. Even though these issues can look similar to one another, they can often be traced back to different underlying causes.
@marco-m the TL;DR of that issue was 'without a go.mod file, gopls can do nothing'.
We are, however, working on changing this, as tracked in https://github.com/golang/go/issues/32587.
gopls
settings as here: https://github.com/golang/go/wiki/goplsSteps to reproduce:
main.go
file in a new directory.An automatic
import "os"
is added. I can hover the mouse overos.Exit
and see pop-up information about the function. If I delete theExit(1)
, place the cursor afteros.
and hit Ctrl-Space, I see an auto-complete menu showing the available functions inos
.Add a
go.mod
file withgo mod init tmp
.Delete the
import "os"
line and save the file again. Now the auto import is no longer added, the hover doc does not appear, and there is no auto-complete menu.(Transferred from https://github.com/Microsoft/vscode-go/issues/2476)