go/internal/lsp
Alan Donovan f487f3623e internal/lsp/source: reduce allocation in workspace-symbols
dynamicSymbolMatch is an allocation hotspot (9% of all bytes),
because it allocates a 3-element []string that quickly becomes
garbage. This change passes in an empty slice with spare capacity
allowing the same array to be reused throughout the matchFile loop.

BenchmarkSymbols on k8s shows -72% bytes, -88% allocs, -9% wall time.

Change-Id: Id20c7cd649874a212e4d4c5f1aa095277b044a5b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/415500
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-07-01 16:22:00 +00:00
..
analysis internal: remove unneeded FileSets 2022-06-06 20:47:10 +00:00
browser
bug internal/lsp: add missing bug reporting, and panic during marker tests 2022-05-31 14:14:38 +00:00
cache internal/memoize: delete Bind(cleanup) hook 2022-07-01 14:51:09 +00:00
cmd internal/lsp: initial test set up for inlay hints 2022-06-09 20:27:29 +00:00
command gopls/internal/vulncheck: include nonaffecting vulnerability info 2022-06-16 14:42:12 +00:00
debug internal/lsp/debug: reduce critical sections in trace 2022-06-17 20:37:28 +00:00
diff internal/span: eliminate TokenConverter 2022-06-01 19:19:15 +00:00
fake internal/lsp: add InlayHint regtests 2022-06-28 15:22:17 +00:00
fuzzy gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
helper
lsppos internal/lsp: factor out go/token wrapper into a safetoken package 2022-05-09 17:03:37 +00:00
lsprpc internal/lsp/regtest: don't run the connection on the test context 2022-06-10 12:48:42 +00:00
mod internal/lsp/mod: fix broken assumptions about file base 2022-06-01 22:04:06 +00:00
progress internal/lsp/progress: detach context for all progress notifications 2022-06-02 20:26:04 +00:00
protocol internal/lsp: add text edits for unkeyed literals 2022-06-30 17:08:31 +00:00
regtest internal/lsp: add InlayHint regtests 2022-06-28 15:22:17 +00:00
safetoken internal/span: eliminate TokenConverter 2022-06-01 19:19:15 +00:00
snippet lsp/completion: fix literal completions with type params 2022-04-26 02:30:39 +00:00
source internal/lsp/source: reduce allocation in workspace-symbols 2022-07-01 16:22:00 +00:00
template internal/lsp: fix source.CompareDiagnostic asymmetry 2022-05-11 17:43:03 +00:00
testdata lsp/completion: fix ranking of *types.PkgName candidates 2022-07-01 14:13:48 +00:00
tests internal/lsp: add settings for inlay hints and enable 2022-06-22 17:08:41 +00:00
work internal/lsp/source: eliminate ColumnMapper.PointSpan in favor of Pos 2022-06-01 19:19:59 +00:00
README.md
call_hierarchy.go
code_action.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
code_lens.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
command.go internal/lsp/progress: detach context for all progress notifications 2022-06-02 20:26:04 +00:00
completion.go internal/lsp/source: remove workaround for newline terminated files 2022-06-01 15:40:59 +00:00
completion_test.go
debounce.go
debounce_test.go
definition.go internal/lsp: use the correct converter for mapped range offsets 2022-06-01 15:32:54 +00:00
diagnostics.go internal/lsp/cache: honor the go.work for computing workspace packages 2022-06-22 14:00:53 +00:00
folding_range.go
format.go internal/lsp: add support for formatting go.work files 2022-02-15 17:15:32 +00:00
general.go internal/lsp: add settings for inlay hints and enable 2022-06-22 17:08:41 +00:00
highlight.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
hover.go internal/lsp: add hover for go.work use statements 2022-03-04 19:55:36 +00:00
implementation.go
inlay_hint.go internal/lsp: rename viewport to range 2022-06-23 18:17:15 +00:00
link.go internal/span: eliminate TokenConverter 2022-06-01 19:19:15 +00:00
lsp_test.go internal/lsp: rename viewport to range 2022-06-23 18:17:15 +00:00
references.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
rename.go internal/lsp: use placeholders with prepare rename 2022-02-15 00:29:01 +00:00
reset_golden.sh
semantic.go internal/lsp/mod: fix broken assumptions about file base 2022-06-01 22:04:06 +00:00
server.go internal/lsp/progress: detach context for all progress notifications 2022-06-02 20:26:04 +00:00
server_gen.go internal/lsp: support textDocument/inlayHint for parameter names 2022-06-10 19:31:11 +00:00
signature_help.go
symbols.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
text_synchronization.go internal/lsp/progress: detach context for all progress notifications 2022-06-02 20:26:04 +00:00
workspace.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
workspace_symbol.go

README.md

lsp

internal/lsp provides much of the Language Server Protocol (lsp) implementation for gopls.

Documentation for users and contributors can be found in the gopls/doc directory.