1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:54:40 -07:00
go/internal/lsp/source
Rebecca Stambler d7101b74a4 internal/lsp: set version correctly after textDocument/didOpen
The early return logic for didOpen events in
(*snapshot).invalidateContent was preventing the creation of a new
snapshot, which was in turn stopping the versions from being updated.

This exposed a fundamental issue in the way we were calculating
workspace diagnostics. Since we weren't waiting for diagnostics to be
completed for an entire snapshot before replying that the server had
been initialized, snapshots were being cloned without any type
information. For quickfix code actions, we assume that we have all
information cached (since we need to have sent the diagnostics that the
quickfix is mapped to), so we were not finding the cached analysis
results.

To handle this in the short-term, we key analyses by their names, and
then regenerate results as-needed for code actions. This is technically
more correct than simply assuming that we have the analyses cached. In a
follow-up CL, I will send a follow-up that will make sure that
snapshots "wait" on each other to be fully constructed before being
cloned.

Change-Id: Ie89fcdb438b6b8b675f87335561bf47b768641ac
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208265
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2019-11-25 19:35:51 +00:00
..
comment_test.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
comment.go internal/lsp: convert comments to markdown before sending to client 2019-10-04 18:35:38 +00:00
completion_format.go internal/lsp: track and parse non-compiled go files 2019-11-25 19:20:50 +00:00
completion_keywords.go internal/lsp: add some keyword completions 2019-10-22 20:49:18 +00:00
completion_labels.go internal/lsp: fix label completion in range and type switch stmts 2019-10-22 21:33:09 +00:00
completion_literal.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
completion_snippet.go internal/lsp: reorganize and refactor code 2019-11-21 02:33:28 +00:00
completion.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
deep_completion.go internal/lsp/source: attach Package to completions when available 2019-11-05 20:21:09 +00:00
diagnostics.go internal/lsp: use snapshot to get reverse dependencies 2019-11-22 02:13:35 +00:00
errors.go internal/lsp: move the missing imports handling into the metadata 2019-09-25 23:05:17 +00:00
folding_range.go internal/span: support line directives 2019-11-25 19:20:43 +00:00
format.go internal/lsp: use version numbers in diagnostic messages 2019-11-21 20:01:42 +00:00
highlight.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
hover.go internal/lsp: add documentation for package-level vars 2019-11-25 18:28:23 +00:00
identifier.go internal/lsp: track and parse non-compiled go files 2019-11-25 19:20:50 +00:00
implementation.go internal/lsp: track and parse non-compiled go files 2019-11-25 19:20:50 +00:00
options.go internal/lsp: set version correctly after textDocument/didOpen 2019-11-25 19:35:51 +00:00
references.go internal/lsp: only search for references in reverse dependencies 2019-11-25 14:46:06 +00:00
rename_check.go internal/lsp: improve literal func completion candidates 2019-11-07 21:18:00 +00:00
rename.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
signature_help.go internal/lsp: use AST to construct placeholders 2019-11-25 01:11:57 +00:00
source_test.go internal/lsp: delete the source.Diagnostic.File field 2019-11-22 00:05:30 +00:00
suggested_fix.go internal/lsp: move error range computations into cache package 2019-10-21 22:12:58 +00:00
symbols.go internal/lsp: reorganize and refactor code 2019-11-21 02:33:28 +00:00
tidy.go internal/lsp: support running go mod tidy as a code action 2019-09-20 13:08:46 +00:00
util.go internal/lsp: track and parse non-compiled go files 2019-11-25 19:20:50 +00:00
view.go internal/lsp: set version correctly after textDocument/didOpen 2019-11-25 19:35:51 +00:00