1
0
mirror of https://github.com/golang/go synced 2024-11-05 15:16:11 -07:00
go/internal/lsp/fake
Rob Findley 20370b0cb4 internal/lsp: honor GOPRIVATE in documentLinks and go.mod hovers
Several fixes related to GOPRIVATE handling and links:
 + In Go source, fix links matching GOPRIVATE for external modules.
   Previously, in these cases we'd try to match <mod>@v1.2.3/<suffix>,
   which wasn't the correct input into the GOPRIVATE matching algorithm.
 + Similarly check GOPRIVATE for go.mod require statement hovers.
 + Likewise, for documentLink requests (both mod and source).
 + Move the existing hover regtest to link_test.go, and expand to cover
   all these cases.

Along the way, I encountered a couple apparent bugs, which I fixed:
 + Correctly handle the case where there is only one require in a go.mod
   file. This was exercised by the regtest, so took some debugging.
 + Only format links [like](this) if the requested format is actually
   markdown.

Fixes golang/go#36998

Change-Id: I92011821f646f2a7449dcca619483f83bdeb54b0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/238029
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-06-18 13:42:42 +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 configurable codeLens 2020-05-08 18:47:35 +00:00
editor.go internal/lsp: honor GOPRIVATE in documentLinks and go.mod hovers 2020-06-18 13:42:42 +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/lsprpc: forward the go environment in initialize requests 2020-06-16 15:43:56 +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/fake: split up and rename the Workspace type 2020-05-06 18:17:57 +00:00