1
0
mirror of https://github.com/golang/go synced 2024-09-30 18:18:32 -06:00
go/internal/lsp/fake
Rebecca Stambler f01a4bec33 internal/lsp: support opening single files
This change permits starting gopls without a root URI or any workspace
folders. If no view is found for an opened file, we try to create a new
view based on the module root of that file. In GOPATH mode, we just
use the directory containing the file.

I wrote a regtest for this by adding a new configuration that gets
propagated to the sandbox. I'm not sure if this is the best way to do
that, so I'll let Rob advise.

Fixes golang/go#34160

Change-Id: I3deca3ac1b86b69eba416891a1c28fd35658a2ed
Reviewed-on: https://go-review.googlesource.com/c/tools/+/240099
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-07-01 22:10:12 +00:00
..
client.go internal/lsp: support go mod vendor as a command 2020-06-04 18:33:45 +00:00
doc.go internal/lsp/fake: split up and rename the Workspace type 2020-05-06 18:17:57 +00:00
edit_test.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
edit.go internal/lsp/fake: define Symbol method on Editor 2020-05-11 20:27:07 +00:00
editor_test.go internal/lsp: support opening single files 2020-07-01 22:10:12 +00:00
editor.go internal/lsp: support opening single files 2020-07-01 22:10:12 +00:00
proxy.go internal/lsp/fake: split up and rename the Workspace type 2020-05-06 18:17:57 +00:00
sandbox.go internal/lsp: support opening single files 2020-07-01 22:10:12 +00:00
workdir_test.go internal/lsp/fake: split up and rename the Workspace type 2020-05-06 18:17:57 +00:00
workdir.go internal/lsp/regtest: add regression tests for on-disk file changes 2020-07-01 22:06:37 +00:00