1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:44:43 -07:00
go/gopls
Michael Matloob a804cf87ae go/packages: handle ad-hoc overlays with sources outside modules
If a user runs a file= query for a source that doesn't exist,
and they are outside of a module, fill in the GoSources for the
empty package that go list returns, so the overlay can be applied.

Also add a hack for the case where go list can't determine the compiler
(gc or gccgo) a user is using because
    go list -f "{{context.Compiler}}" -- unsafe
doesn't work. If go list complains that a user is outside a module,
we'll give ourselves flexibility to guess things because there's
no right answer. So we'll guess that the compiler is gc.

Fixes golang/go#33482

Change-Id: I6a8aa0c617c4d803558389fb4272854245f59c5a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/189322
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-08-08 19:06:35 +00:00
..
go.mod gopls: update x/tools vesion in mod file 2019-07-24 18:50:37 +00:00
go.sum go/packages: handle ad-hoc overlays with sources outside modules 2019-08-08 19:06:35 +00:00
main.go internal/lsp: have tests report a different application name to the main gopls binary 2019-07-18 23:01:26 +00:00