1
0
mirror of https://github.com/golang/go synced 2024-10-01 05:28:33 -06:00
go/internal/lsp
Heschi Kreinick fda23558a1 internal/lsp/cache: only refresh imports cache every 30 seconds
Loading completion suggestions can be slow, especially in GOPATH mode
where basically anything can change at any time. As a compromise, cache
everything for 30 seconds. Specifically, after a completion operation
finishes, if the cache is more than 30 seconds old, refresh it
asynchronously. That keeps user-facing latency consistent, without
chewing up CPU when the editor isn't in use. It does mean that if you
walk away for an hour and come back, the first completion may be stale.

In module mode this is relatively benign. The only things the
longer caching affects are the main module and replace targets, and
relevant packages in those will generally be loaded by gopls, so they'll
have full, up-to-date type information regardless.

In GOPATH mode this may be more troublesome, since it affects
everything. In particular, go get -u of a package that isn't imported
yet won't be reflected until the cache period expires. I think that's a
rare enough case not to worry about.

Change-Id: Iaadfd0ff647cda2b1dcdead9254b5492b397e86e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/205163
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-11-04 21:31:29 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp/cache: only refresh imports cache every 30 seconds 2019-11-04 21:31:29 +00:00
cmd internal/lsp: fix race condition in metadata handling 2019-11-04 20:35:57 +00:00
debug internal/lsp: hardcode the version string on master 2019-11-04 17:57:16 +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: fix fuzzy matcher inconsistency 2019-10-22 21:05:28 +00:00
protocol internal/lsp: cancel early 2019-10-22 07:49:31 +00:00
snippet all: fix broken links to LSP specification 2019-10-02 18:32:53 +00:00
source internal/lsp: use available type info for unimported completions 2019-11-04 21:31:10 +00:00
telemetry internal/lsp/cache: add additional spans for tracing 2019-09-05 21:33:45 +00:00
testdata internal/lsp: use available type info for unimported completions 2019-11-04 21:31:10 +00:00
tests internal/lsp/source: propose exports for unimported packages 2019-11-04 21:31:03 +00:00
code_action.go internal/lsp: remove analyzers from Analyze result 2019-10-25 02:35:17 +00:00
command.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
completion_test.go internal/lsp: disable completion time budget in tests 2019-10-25 16:51:05 +00:00
completion.go internal/lsp: fix VSCode's reordering of completion candidates 2019-10-24 16:29:03 +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: enable textDocument/implementation request 2019-11-01 15:52:25 +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
implementation.go internal/lsp: add support for implements to the LSP 2019-10-31 16:03:44 +00:00
link.go internal/lsp: rework snapshots and cache FileHandles per-snapshot 2019-10-01 16:26:22 +00:00
lsp_test.go tools/gopls: add cmd support for symbols 2019-11-01 17:43:07 +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: add support for implements to the LSP 2019-10-31 16:03:44 +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: fix nil pointer in textDocument/didClose 2019-11-04 17:19:25 +00:00
watched_files.go internal/lsp: type check packages in parallel 2019-10-29 04:13:27 +00:00
workspace.go internal/lsp: merge session and view options into one 2019-09-11 19:36:49 +00:00