-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: Extend hover ability to get the type of selected expression #69058
Comments
Thanks. We've talked about such a feature in the past, but have always been limited by the fact that Looks like rust-analyzer added a CC @adonovan, who I believe has thought about this exact feature. |
See:
As soon as LSP supports a range in a hover request, we should add support for it to gopls. |
Change https://go.dev/cl/609656 mentions this issue: |
It already works in neovim, amazing 🚀 |
I nudged the 377 issue last night and I think the dominoes may be close to toppling. |
Yes, by adding range param to requst of TextDocument/Hover, something like local range = require("vim.lsp.buf").range_from_selection(0, mode)
local param = vim.lsp.util.make_position_params(0, nil)
param.range = range
vim.lsp.buf_request(0, "textDocument/hover", param, handler) screenshot: iShot_2024-08-31_11.11.43.mp4 |
gopls version
golang.org/x/tools/gopls v0.0.0-20240816163142-66adacf20fc4
golang.org/x/tools/[email protected] h1:iSreTB1mHFYjQkoNmGjFjKRGkrhedt4wmfg
47nKSo28=
github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH
3x7MAiqGW6Y=
golang.org/x/[email protected] h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/[email protected] h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/[email protected] h1:nU8/tAV/21mkPrCjACUeSibjhynTovgRMXc32
+Y1Aec=
golang.org/x/[email protected] h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/[email protected] h1:PoPnfVMls3TamN2+Zq6FsI1uSjUOqW1mt6AXfY
w3kdw=
golang.org/x/[email protected] h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
honnef.co/go/[email protected] h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
mvdan.cc/[email protected] h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.22.4
go env
What did you do?
As the title says, get the type info of seleted range.
in Goland
https://github.com/user-attachments/assets/7eea395f-490f-420f-8c8e-d1897f679f0e
in rust-analyzer
documentation
iShot_2024-08-25_10.07.24.mp4
What did you see happen?
We can't hover in selection state to get type information
What did you expect to see?
Get the type info of seleted range.
related:rust-lang/rust-analyzer#9693
Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered: