go/internal/lsp/lsprpc
Rob Findley 330dc7d2a4 internal/lsp/cache: assign a static temp workspace dir to the first view
Editors need a way to run commands in the same workspace that gopls
sees. Longer term, we need a good solution for this that supports
multiple workspace folders, but for now just write the first folder's
workspace to a deterministic location:
  $TMPDIR/gopls-<client PID>.workspace.

Using the client-provided PID allows this mechanism to work even for
multi-session daemons.

Along the way, simplify the snapshot reinitialization logic a bit.

Fixes golang/go#42126

Change-Id: I5b9f454fcf1a1a8fa49a4b0a122e55e762d398b4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/264618
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
2020-11-04 18:18:50 +00:00
..
autostart_default.go internal/lsp: fix builds and tests for go1.12+ 2020-08-27 14:30:46 +00:00
autostart_posix.go internal/lsp: fix builds and tests for go1.12+ 2020-08-27 14:30:46 +00:00
lsprpc.go internal/lsp/cache: assign a static temp workspace dir to the first view 2020-11-04 18:18:50 +00:00
lsprpc_test.go internal/lsp: fix builds and tests for go1.12+ 2020-08-27 14:30:46 +00:00