[vscode-go] extension/src/language: attach selected range to hover request

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Oct 1, 2025, 4:19:36 PM (12 hours ago) Oct 1
to Hongxiang Jiang, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Madeline Kalil, Go LUCI, Alan Donovan, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
extension/src/language: attach selected range to hover request

The middleware API allow the extension developer to modify the
input parameter of the call back function "next" but does not
allow the extension developer to introduce new arguments.

The vscode-languageclient still responsible for the putting up
the final parameter and send to gopls.

Based on the proposal from microsoft/language-server-protocol#377,
the final state is introducing a "range" field in PositionParams.
I think it make more sense to call a separate gopls command
"gopls.lsp" with method "hover" (CL 706335) instead of forcely
embeding a "range" field to the "position" field.

The vscode-go extension only send the selected range if the range
and the original position come from the same text document.

For golang/go#69058
Change-Id: Ie65a5d62d220882865a22f3749ed9330b6234975
Auto-Submit: Hongxiang Jiang <hxj...@golang.org>
Reviewed-by: Madeline Kalil <mka...@google.com>
Files:
  • M extension/src/language/goLanguageServer.ts
Change size: S
Delta: 1 file changed, 35 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Madeline Kalil
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: Ie65a5d62d220882865a22f3749ed9330b6234975
Gerrit-Change-Number: 706336
Gerrit-PatchSet: 7
Gerrit-Owner: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages