-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cursor position is pretty weird in inlay hints #1623
Comments
I guess this is a VSCode constraint, especially since decorations aren't really meant to be used like this. An easy way to make this a bit better might be to shorten the max length of inlay hints, i.e. showing just |
That will remain as is for now, unfortunately. Here's a VS Code issue about true parameter hints support: microsoft/vscode#16221 |
What we might want to try is attaching the decoration before the following token, and not after the binding. Not sure if it's a good idea though. |
inb4 let really_long_identifier_that_is_very_descriptive
= "but it also like to have my equal signs on the next line"; Edit: Fine, @matklad wins |
@killercup the next token here is whitespace ;) |
I think I've tried that on the rls-vscode client, and the cursor still insists on going to the right of the decoration. Might be wrong though, so do check it, should be a quick enough hack to try :) Also, keeping the decoration tied to the variable name makes hovering over the hint behave the same as Hovering over the variable, which is more convenient and might be used to show a more detailed type hint (without the abridgements for example) |
Thanks for the input @p-avital Closing as an upstream issue then! Just a reminder, it's possible to completely disable hints in the settings |
This is still a client side issue with VSCode, not something r-a has control over |
I actually place it after p so it should look like p|, instead, it was placed after the whole inlay hints.
If I type something, it correctly put the characters behind "p" though.
In this case, it is trivial.
But if the inlay hints are long, this would be awkward to handle. See the demo below
The text was updated successfully, but these errors were encountered: