Skip to content
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

WIP: Evaluate variables on hover #2127

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andyleejordan
Copy link
Member

If their value is available (either because its been set in the session manually, or the script has been executed or is being debugged) we can return it on the hover.

We should ask if we actually want to do this, and if so, how we want to format it.

@JustinGrote try this out!

Fixes PowerShell/vscode-powershell#4878.

If their value is available (either because its been set in the session
manually, or the script has been executed or is being debugged) we can
return it on the hover.

We should ask if we actually want to do this, and if so, how we want to
format it.
@JustinGrote
Copy link
Collaborator

JustinGrote commented Oct 18, 2024

Sorry for the looong delay on looking at this.

So my main concern here is snappiness. Because the LSP spec only has a single hover request and reply, running the evaluate through the pipeline delays the hover by a lot. If we had a refresh mechanism like inlay, that wouldn't be an issue (requested here)

So I think we should keep "fast" out of band hovers as much as possible to keep things snappy, but more detailed hovers that require a pipeline request would have to be setting opt-in as they would be slower to produce (we can report using the progress token as well as cache responses for things like help) until we had a streaming approach.

@JustinGrote
Copy link
Collaborator

Example (builtin function def) vs Variable. 3ms vs 300ms
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explicit String Variables (e.g. ${variable}) do not resolve in debugging
3 participants