go/internal/lsp
Heschi Kreinick d2fffb4b84 internal/imports: cache things outside the mod cache
Since a user's module cache is generally going to be much bigger than
their main module, one would expect that caching just information about
the module cache would be sufficient. It turns out that's not correct.
When we discover something in the module cache, we have to make sure
that a different version of it isn't already in scope. Doing that can
require information about the main module or replace targets, so that
needs to be cached too.

Concretely, when I'm working in x/tools, if a scan discovers a version
of x/tools in the module cache, it should usually ignore that version.
But that might not be true in more complicated cases, especially those
involving nested modules whose boundaries change.

So, cache everything except GOROOT. Since the new data is mutable,
we store it separately from the module cache data so that it can be
discarded easily between runs.

Change-Id: I47364f6c0270fee03af8898fec6c85d1b9c8d780
Reviewed-on: https://go-review.googlesource.com/c/tools/+/202045
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-21 20:45:41 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/imports: cache things outside the mod cache 2019-10-21 20:45:41 +00:00
cmd internal/lsp: add a test to make sure we handle bad imports 2019-10-17 20:52:05 +00:00
debug internal/lsp: address staticcheck warnings 2019-10-04 02:16:23 +00:00
diff internal/lsp: fix unified diffs of edits at the end of a file 2019-10-11 16:38:14 +00:00
fuzzy internal/lsp: address staticcheck warnings 2019-10-04 02:16:23 +00:00
protocol internal/lsp: fix lsp trace log format for gopls 2019-10-16 17:14:07 +00:00
snippet all: fix broken links to LSP specification 2019-10-02 18:32:53 +00:00
source internal/imports: return non-stdlib candidates from GetAllCandidates 2019-10-21 20:45:15 +00:00
telemetry internal/lsp/cache: add additional spans for tracing 2019-09-05 21:33:45 +00:00
testdata internal/imports: return non-stdlib candidates from GetAllCandidates 2019-10-21 20:45:15 +00:00
tests internal/imports: return non-stdlib candidates from GetAllCandidates 2019-10-21 20:45:15 +00:00
code_action.go internal/lsp: return an error from {Narrowest,Widest}CheckPackageHandle 2019-10-11 16:51:06 +00:00
command.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
completion.go internal/lsp: restore "IsIncomplete" completion flag 2019-10-04 02:16:33 +00:00
completion_test.go internal/imports: return non-stdlib candidates from GetAllCandidates 2019-10-21 20:45:15 +00:00
definition.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
diagnostics.go go/analysis, internal/lsp: add support for related information 2019-10-21 19:00:55 +00:00
folding_range.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
format.go internal/lsp: change to protocol.TextEdit for formatting 2019-09-06 17:54:09 +00:00
general.go internal/lsp/protocol: update to protocol version 3.15 2019-09-25 02:06:47 +00:00
highlight.go x/tools/gopls: convert to the august, 2019 version of the LSP protocol 2019-09-08 13:59:31 +00:00
hover.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
link.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
lsp_test.go internal/lsp: add a test to make sure we handle bad imports 2019-10-17 20:52:05 +00:00
references.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
rename.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
reset_golden.sh internal/lsp: fix regeneration of golden files 2019-09-25 13:16:59 +00:00
server.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
signature_help.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
symbols.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
text_synchronization.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
watched_files.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
workspace.go internal/lsp: merge session and view options into one 2019-09-11 19:36:49 +00:00