go/internal/lsp/command
Rob Findley 6d45e3d999 internal/lsp: add a temp workspace per folder, and a helper command
Locating the workspace module by convention has multiple problems:
 + gopls's view of $TMPDIR might be different from the client
 + there might be multiple views
 + there might be multiple gopls sessions per pid

Instead, assign a temp workspace directory for each workspace folder,
and provide a command to access this information.

Cleaning up all these temp directories was overcomplicated. Instead,
create a temp directory for the gopls server to nest them under, that
can be removed up on server shutdown.

Also fix a bug where the snapshot was not acquired before copying its
workspace.

Updates golang/go#42252

Change-Id: I0641cebe09cd376dfa27373cac30397711c64a8f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/300409
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-03-15 23:11:33 +00:00
..
commandmeta internal/lsp/command: pass Context to commands 2021-02-09 23:13:16 +00:00
gen all: fmt tests with new gofmt 2021-02-20 03:28:42 +00:00
command_gen.go internal/lsp: add a temp workspace per folder, and a helper command 2021-03-15 23:11:33 +00:00
generate.go all: fmt tests with new gofmt 2021-02-20 03:28:42 +00:00
interface.go internal/lsp: add a temp workspace per folder, and a helper command 2021-03-15 23:11:33 +00:00
interface_test.go internal/lsp/command: rename package generate to gen 2021-02-17 22:11:19 +00:00
util.go internal/lsp: switch to the new command API 2021-02-09 22:09:28 +00:00