tools/gopls/internal/cmd
Alan Donovan e26dff9fb9 gopls/internal/golang: semtok: use type information consistently
Previously there were two competing mechanisms for annotating
identifiers: the syntactic traversal and type information.
This meant that identifiers in different grammatical places
were annotated differently.

This change annotates identifiers using type information exclusively.
In addition to making things consistent, it also means that
types are reported independently (using modifiers) to symbol kind,
so, for example, a "var x func()" is a Variable with modifier
Signature, indicating that its type is a function.
Also, the rules for "defaultLibrary", "readonly", and so on
are more simply and consistently enforced.

The "deprecated" modifier is however lost as a consequence,
as it relied on the syntax.

+ Tests for both issues.

Also, use an enum for all the Modifiers.

Also, document the complete current set of token types
and modifiers that gopls returns.

Fixes golang/go#66809
Fixes golang/go#70251

Change-Id: I15e59d10f5a9269bc6be87f30e3502a9054d88e7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/626279
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-11 18:34:52 +00:00
..
usage gopls/internal/test/integration/bench: add an IWL test that opens files 2024-09-26 14:44:37 +00:00
call_hierarchy.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
capabilities_test.go gopls/internal/server: CodeAction: interpret Only=[] as [QuickFix] 2024-10-01 18:55:11 +00:00
check.go x/tools/gopls: delete code obsoleted by go1.23 2024-09-09 18:00:29 +00:00
cmd.go gopls/internal/protocol: upgrade to latest LSP 2024-11-11 14:12:59 +00:00
codeaction.go gopls/internal/server: CodeAction: interpret Only=[] as [QuickFix] 2024-10-01 18:55:11 +00:00
codelens.go gopls/internal/settings: move CodeLensSource from protocol 2024-06-20 14:20:31 +00:00
definition.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
execute.go gopls: allow for asynchronous request handling 2024-10-18 20:45:24 +00:00
folding_range.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
format.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
help_test.go gopls: eliminate the hooks package 2024-04-12 20:56:48 +00:00
highlight.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
implementation.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
imports.go gopls/internal/server: CodeAction: interpret Only=[] as [QuickFix] 2024-10-01 18:55:11 +00:00
info.go gopls: rationalize code generation 2024-05-08 16:57:03 +00:00
integration_test.go gopls/internal/golang: semtok: use type information consistently 2024-11-11 18:34:52 +00:00
links.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
parsespan.go gopls/internal/protocol: move out of lsp/ 2024-01-24 00:48:12 +00:00
prepare_rename.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
references.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
remote.go gopls/internal/protocol/command: use gopls.foo form everywhere 2024-06-07 14:44:27 +00:00
rename.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
semantictokens.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
serve.go gopls: upload from telemetry.Start, rather than upload.Run 2024-05-15 13:08:18 +00:00
signature.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
span.go gopls/internal/protocol: move out of lsp/ 2024-01-24 00:48:12 +00:00
spanformat_test.go gopls/internal/cmd: move span.{Span,Point} to cmd 2023-11-14 21:46:08 +00:00
stats.go gopls/internal/protocol/command: use gopls.foo form everywhere 2024-06-07 14:44:27 +00:00
subcommands.go gopls/internal/lsp/cmd: move to ../cmd 2023-11-13 23:29:59 +00:00
symbols.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00
vulncheck.go gopls/internal/protocol/command: move from ../lsp 2024-01-24 00:48:14 +00:00
workspace_symbol.go gopls/internal/cmd: cleanup progress handling 2024-06-07 14:36:04 +00:00