-
-
Notifications
You must be signed in to change notification settings - Fork 868
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
wish: add key to kill-ring-save the inferred type #1708
Comments
The issue is that this information is not structured and might not be the type itself. I think that the only reliable server-side method for that matter is documentSymbols call(corresponds to |
Can the mechanism behind |
Note, I filled a similar wish for vscode: microsoft/vscode#98267 |
This is RA specific. We could provide a mechanism to copy the inlay-hint on the line, this will be easy, but it will work only for rust analyzer. |
Another option maybe is to parse what the minibuffer shows, at least for |
Yep, in order to work consistently.
I tend to avoid such ad-hoc solutions because they cause trouble. After all, lsp protocol is to avoid client side parsing. |
ok, I understand. Note, others are finding this same LSP limitation and for a more general usage, as getting the type of a selected expression instead of only of the symbol at cursor: |
yep, unfortunately, the spec is designed for point-and-click usage. |
closing based on the previous comment. Once the spec adds support for it we can implement the client-side code. |
Many times I want to type an inferred type, it will be nice to have a shorcut to copy the type below the cursor. Typescript example:
Here cursor is over
x
, so the inferred type is shown in the minibuffer asconst x: SomeType
. Now it will be nice to press a (new) shorcut that copies thex
type name to the clipboard, so then you can move the cursor afterarg
, type:
and then C-Y to pasteSomeType
, to declare the type ofarg
as the same ofx
.The text was updated successfully, but these errors were encountered: