Change information
Commit message:
gopls/internal/server: support type def with selected range
The logical validation for textDocumentPositionParam is moved
to protocol level ensures the validation will be done for all
LSP method param who extends textDocumentPositionParam.
gopls type def will be able to interpret the selected range
from the lsp client. If the selected range evaludate to an
expression, gopls will return the type of the expression.
gopls will return multiple locations for types.Signature or
Tuple without any special filering for type error.
vscode-go CL 727560
For golang/go#76723
Change-Id: I63e241da7b87d31f94e41db7d252e8230789579c
Files:
- M gopls/internal/golang/hover.go
- M gopls/internal/golang/identifier.go
- M gopls/internal/golang/type_definition.go
- M gopls/internal/protocol/generate/output.go
- M gopls/internal/protocol/tsserver.go
- M gopls/internal/server/definition.go
- M gopls/internal/server/hover.go
- M gopls/internal/test/integration/fake/editor.go
- M gopls/internal/test/integration/misc/definition_test.go
- A gopls/internal/test/marker/testdata/typedef/expression.txt
- M gopls/internal/test/marker/testdata/typedef/typedef.txt
Change size: L
Delta: 11 files changed, 198 insertions(+), 133 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Madeline Kalil
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI