go/gopls/internal/lsp
Alan Donovan 2592a854ec gopls/internal/lsp: simplify KnownPackages
This change simplifies the two functions called KnownPackages,
and renames one of them.

The first, source.KnownPackages, is a standalone function
called in exactly one place: ListKnownPackages.
It has been renamed KnownPackagePaths to distinguish
from the other and to make clear that it returns only
metadata. Its implementation could be greatly simplified
in a follow-up, as noted. In the meantime, one obviously
wrong use of ImportSpec.Path.Value (a quoted string literal!)
as an package (not import!) path was fixed, and the package
name was obtained directly, not via CompiledGoFiles.

The second, Snapshot.KnownPackagePaths, is called from two places.
This CL eliminates one of them: stubMethods used it apparently
only to populate a field of missingInterface (pkg) that was unused.
The other call (from 'implementations') is something that should
eventually go away as we incrementalize; in any case it doesn't
rely on the undocumented ordering invariant established by the
implementation. This change removes the ordering invariant,
documents the lack of order, and removes the ordering logic.

Change-Id: Ia515a62c2d78276b3344f2880c22746b2c06ff64
Reviewed-on: https://go-review.googlesource.com/c/tools/+/451675
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-11-18 17:22:07 +00:00
..
analysis go/analysis: add Pass.TypeErrors field 2022-11-16 21:35:14 +00:00
browser gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
cache gopls/internal/lsp: simplify KnownPackages 2022-11-18 17:22:07 +00:00
cmd gopls: sync golang.org/x/vuln@3af8368ee4fe 2022-11-10 23:14:17 +00:00
command gopls/internal/lsp: use the golang.org/x/vuln/exp/govulncheck 2022-10-11 21:42:28 +00:00
debug gopls/internal/lsp: delete dead code 2022-09-28 18:44:21 +00:00
fake gopls/fake: add semantic token modifiers to fake editor 2022-11-07 18:28:08 +00:00
helper gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
lsppos all: fix a few function names on comments 2022-10-10 13:22:38 +00:00
lsprpc gopls/internal/lsp/lsprpc: eliminate arbitrary timeout in TestEnvForwarding 2022-11-17 19:20:03 +00:00
mod gopls/internal/lsp/mod: fix unaffecting vuln diagnostics msgs 2022-11-18 15:58:55 +00:00
progress gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
protocol gopls/internal: start on LSP stub generator in Go. 2022-10-26 13:02:30 +00:00
regtest internal/testenv: skip tests that need export data for std if 'go tool compile' does not exist 2022-11-17 20:46:33 +00:00
safetoken internal/testenv: skip tests that need export data for std if 'go tool compile' does not exist 2022-11-17 20:46:33 +00:00
snippet gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
source gopls/internal/lsp: simplify KnownPackages 2022-11-18 17:22:07 +00:00
template gopls/internal/span: move internal/span into gopls 2022-10-07 14:50:44 +00:00
testdata gopls/semantic: semantic tokens for type parameters 2022-11-16 14:49:29 +00:00
tests internal/diff: ToUnified may fail 2022-10-07 15:16:55 +00:00
work gopls/internal/lsp: fix diagnostic suppression when folders change 2022-11-15 00:02:48 +00:00
README.md gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
call_hierarchy.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
code_action.go gopls: dedup upgrade code actions for vulncheck 2022-10-12 18:24:48 +00:00
code_lens.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
command.go gopls/internal/lsp: simplify KnownPackages 2022-11-18 17:22:07 +00:00
completion.go gopls/internal/lsp/cache: use Package.FileSet where possible 2022-11-11 15:24:32 +00:00
completion_test.go gopls/internal/span: move internal/span into gopls 2022-10-07 14:50:44 +00:00
debounce.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
debounce_test.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
definition.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
diagnostics.go gopls/internal/lsp: fix diagnostic suppression when folders change 2022-11-15 00:02:48 +00:00
folding_range.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
format.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
general.go gopls/internal/lsp: clarify control around diagnostics 2022-11-01 21:03:16 +00:00
general_test.go gopls/internal: don't show a warning if the Go version is undetected 2022-10-28 15:53:15 +00:00
highlight.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
hover.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
implementation.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
inlay_hint.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
link.go gopls/internal/lsp/cache: use typed strings (PackagePath et al) throughout 2022-11-11 03:59:42 +00:00
lsp_test.go gopls/internal/span: some cleanups 2022-10-13 13:15:27 +00:00
references.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
rename.go gopls/internal/span: move internal/span into gopls 2022-10-07 14:50:44 +00:00
reset_golden.sh gopls: fix the reset_golden.sh script and regenerate golden files 2022-09-26 18:57:12 +00:00
semantic.go gopls/semantic: semantic tokens for type parameters 2022-11-16 14:49:29 +00:00
server.go gopls/internal/lsp/cache: use typed strings (PackagePath et al) throughout 2022-11-11 03:59:42 +00:00
server_gen.go internal/lsp: latest version of LSP stubs 2022-09-13 15:21:19 +00:00
signature_help.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
symbols.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
text_synchronization.go gopls/internal/regtest: simplify awaiting diagnostics from a change 2022-11-07 14:31:48 +00:00
workspace.go gopls/internal/lsp: warn about Go versions that are too old 2022-10-07 17:55:15 +00:00
workspace_symbol.go gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00

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.