PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

WIP: Evaluate variables on hover

Open andyleejordan opened this issue 1 year ago • 2 comments

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 https://github.com/PowerShell/vscode-powershell/issues/4878.

andyleejordan avatar Jan 05 '24 01:01 andyleejordan

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 avatar Oct 18 '24 20:10 JustinGrote

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

JustinGrote avatar Oct 18 '24 20:10 JustinGrote