go/internal
Robert Findley d303668635 internal/lsp/cache: use cached parsed files for symbols, if available
Optimize building the symbol index for a file, in two ways:
 - use the cached full parse tree, if it already exists
 - if it doesn't exist, optimize parsing by skipping both comments and
   object resolution, which aren't necessary for symbols

This results in around 3x faster initial indexing of symbols. In my
manual testing, indexing of Kubernetes went from 16s->5s, and indexing
of x/tools went from 2.4s->700ms.

Also fix a typo in gopls/internal/regtest/bench/bench_test.go.

Fixes #52602

Change-Id: I0893e95410be96e94e5e9dee7a3aab30b59c19c5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403679
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2022-05-09 17:04:06 +00:00
..
analysisinternal go/analysis/passes/tests: Check malformed fuzz target. 2022-02-16 18:26:19 +00:00
apidiff all: gofmt 2022-04-12 17:53:17 +00:00
event all: gofmt 2022-04-12 17:53:17 +00:00
fakenet
fastwalk all: gofmt 2022-04-12 17:53:17 +00:00
gocommand internal/imports: update to permit multiple main modules 2022-02-22 17:36:43 +00:00
gopathwalk internal/gopathwalk: remove unnecessary call to os.Lstat 2022-03-31 05:33:07 +00:00
imports all: gofmt 2022-04-12 17:53:17 +00:00
jsonrpc2 internal/jsonrpc2*: remove usage of golang.org/x/xerrors 2022-04-20 16:10:40 +00:00
jsonrpc2_v2 internal/jsonrpc2*: remove usage of golang.org/x/xerrors 2022-04-20 16:10:40 +00:00
lsp internal/lsp/cache: use cached parsed files for symbols, if available 2022-05-09 17:04:06 +00:00
memoize all: gofmt 2022-04-12 17:53:17 +00:00
packagesinternal x/tools/go/packages: on Go 1.19+, explicitly ask for -json fields needed 2022-04-19 17:08:06 +00:00
proxydir
span internal: remove pre-go1.12 conditionally compiled files 2022-05-05 16:48:28 +00:00
stack all: gofmt 2022-04-12 17:53:17 +00:00
testenv internal: remove pre-go1.12 conditionally compiled files 2022-05-05 16:48:28 +00:00
tool internal/tool: implement structured help command 2022-05-04 22:58:41 +00:00
typeparams all: gofmt 2022-04-12 17:53:17 +00:00
typesinternal internal/typesinternal: update typesinternal for 1.18 2022-02-22 16:42:18 +00:00
xcontext