go/internal/lsp/testdata/workspacesymbol
Rob Findley 0f3931c766 internal/lsp: precompute workspace symbols
Coupling workspace symbols to package checking means that they do not
function when the workspace is contracted, and also forces us to do
duplicate work traversing file declarations.

This CL changes the workspace symbol implementation to precompute
symbols based only on syntactic information, allowing them to function
in degraded workspace mode, improving their performance, and laying the
groundwork for more significant performance improvement later on.

There is some loss of precision where we can't determine the kind of a
symbol from syntactic information alone, but this is minor: we fall back
on 'Class' if we can't determine whether a type definition is a basic
type, struct, or interface.

Benchmark ("test" in x/tools): 56ms->40ms
Benchmark ("test" in kuberneted): 874ms->799ms

Change-Id: Ic48df29b387bf029dd374d7d09720746bc27ae5e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/338692
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-08-09 20:20:17 +00:00
..
a
b
p internal/lsp: rewrite the workspace symbol marker tests 2020-11-24 17:38:01 +00:00
issue44806.go internal/lsp/source: correct workspace symbol logic for unpacking receivers 2021-03-05 19:21:50 +00:00
main.go internal/lsp: rewrite the workspace symbol marker tests 2020-11-24 17:38:01 +00:00
query.go internal/lsp: rewrite the workspace symbol marker tests 2020-11-24 17:38:01 +00:00
query.go.golden internal/lsp: precompute workspace symbols 2021-08-09 20:20:17 +00:00