-
Notifications
You must be signed in to change notification settings - Fork 30.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
Inlay hints' text edits do not apply when being resolved #193124
Comments
Please attach a minimal but complete code sample that allows me to reproduce this |
Alas, I'm not aware of any other langserver capable of sending hints' edits, so I'm using rust-analyzer as an example, any latest version has this.
fn main() {
let test = "foo".to_string();
}
rust-analyzer resolves both properties ( LSP trace I'm getting for this sequence
I would assume you can adjust VSCode to not to send |
If it's helpful, here are the json responses rust-analyzer language server emits for the example above
there seems nothing in |
VSCode behaves strangely, allowing to navigate into label location, but not allowing to apply hint's text edit, after hint is resolved. See microsoft/vscode#193124 for details. For now, stub hint resolution for VSCode specifically.
VSCode behaves strangely, allowing to navigate into label location, but not allowing to apply hint's text edit, after hint is resolved. See microsoft/vscode#193124 for details. For now, stub hint resolution for VSCode specifically.
Do not resolve inlayHint.textEdit for VSCode client Closes #15604 VSCode behaves strangely, allowing to navigate into label location, but not allowing to apply hint's text edit, after hint is resolved. See microsoft/vscode#193124 for details. For now, stub hint resolution for VSCode specifically.
A small update: I've added a workaround into rust-analyzer, so now, in order to reproduce it with VSCode, somebody has to either change the |
Hey @jrieken, this issue might need further attention. @SomeoneToIgnore, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
Can confirm this is still a thing with the edits only. |
Hi, I am a dev from it looks like it is a bug either in when but vscode/src/vs/editor/contrib/inlayHints/browser/inlayHints.ts Lines 58 to 59 in 7452aaa
so either ... but that said, for us, we want and also, it looks like all it needs to fix the issue is just adding one line to the vscode above. this.hint.textEdits = newHint?.textEdits ?? this.hint.textEdits; |
there are actually multiple places in vscode/src/vs/workbench/api/common/extHostLanguageFeatures.ts Lines 1460 to 1468 in 7452aaa
but none of others do. |
Thank you @heejaechang ! |
After microsoft/vscode#193124 was fixed, this change is not needed anymore.
After microsoft/vscode#193124 was fixed, this change is not needed anymore.
After microsoft/vscode#193124 was fixed, this change is not needed anymore.
Stop eagerly resolving inlay hint text edits for VSCode Send less json over the wire. After microsoft/vscode#193124 was fixed, this change is not needed anymore. VSCode 1.86.0 now supports double click for unresolved hint data too.
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
textEdits
field of inlay hints, e.g. rust-analyzerExpected: the document gets edited with hint contents
Actual: nothing happens, but hint resolve definitely happens as LSP log shows, and we can cmd+click certain hints (which means r-a resolved
label.location
)Additional information: if
textEdits
is not resolved (see patch for rust-analyzer in rust-lang/rust-analyzer#15604 or remove the corresponding client hint resolve capability), double clicking the hint works.The text was updated successfully, but these errors were encountered: