-
Notifications
You must be signed in to change notification settings - Fork 36
Support inlay hints in code chunks #707
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
Conversation
I've done a decent amount of work looking at this and reworking the PR, but I'm honestly not sure if it is worth it because there are a number of restrictions. Basically the only time this seems to currently be useful right now is with Python when you are in VS Code. It does seem like a nice feature but I'm not sure if it is worth the headache for us right now. Does not work for Python in Positron by defaultJedi doesn't support inlay hints, so you don't get them by default in Positron. You have to also install basedpyright and I'm not sure if that is going to interact badly with our LSP or not. Does not work for RSince we don't have strong typing for R we won't be able to support this Can't figure out why it doesn't work for TypeScriptI can't exactly figure out why, but a TypeScript code block "typescript.inlayHints.parameterNames.enabled": "all",
"typescript.inlayHints.variableTypes.enabled": true,
"typescript.inlayHints.parameterTypes.enabled": true, I'm also not sure what other languages that Quarto supports as "executable code blocks" would benefit from this. Does not support the "resolve" aspect of inlay hintsThis isn't a huge deal, but inlay hints are broken into two stages: "provide" and "resolve". Most LSP commands that are broken down in this way and are then called through an API command like What this means in practice is that if your LSP "delays" the Screen.Recording.2025-05-20.at.12.22.40.PM.movScreen.Recording.2025-05-20.at.12.25.00.PM.movAccepting inlay hints can make arbitrary text editsMaybe this is expected, but when you accept certain text edits it can also add import statements to the top of the file, like with Screen.Recording.2025-05-20.at.12.26.16.PM.movHave to avoid calling it on
|
Thank you so much for this contribution, @kv9898! We so appreciate your willingness to dig into functionality across Positron, ark, and Quarto. 🙌 We chatted together and have decided that unfortunately we are not going to move forward with inlay hints for Quarto at the current time. We are not satisfied with where we have been able to get the experience to, starting with your work and then the time that @DavisVaughan has spent on it, especially relative to which kinds of users in what situations it will benefit. Thank you again so much for your interest in these projects, and I'm sorry that we are not moving forward with this at the current time. Maybe we can spend more time in the future on how this LSP feature interacts in these complex Quarto situations. |
Thanks again @kv9898! |
Use
vscode.executeInlayHintProvider
to retrieve hints for virtual docs and convert the ranges.Here's a demo (with basedpyright+Positron)
inlayHints.mp4