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

Add "lazy" property to the VariablePresentationHint #246

Closed
weinand opened this issue Feb 10, 2022 · 3 comments
Closed

Add "lazy" property to the VariablePresentationHint #246

weinand opened this issue Feb 10, 2022 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Feb 10, 2022

In microsoft/vscode#134450 it was discussed how to support variables that are expensive/have side-effects and can be lazily evaluated.

Since DAP's variable request is inherently lazy, it is already possible to support lazy evaluation of expensive variables by introducing an intermediate variable with exactly one child. Expanding this variable in the client UI will trigger the "lazy evaluation" of the value by fetching the single child.

The only problem with this approach is that the intermediate variable makes the UI more noisy by introducing an additional node in the variables tree. To address this, we agreed to introduce a "presentation hint" on a variable that tells a client to render the variable in a way that reduces the noise.

So the proposal is to add an optional boolean flag lazy on the VariablePresentationHint type.

@puremourning
Copy link
Contributor

But it's not a "presentation hint" though really is it? It's more like the "expensive" flag on the scope ?

Clients are free to ignore presentation hints I believe and if adapters start putting stuff in there that has material value (such as not causing side-effects), I think it should have more prominence.

WDYT?

@weinand
Copy link
Contributor Author

weinand commented Feb 10, 2022

@puremourning existing DAs are using the mechanism already without the "lazy" flag and without additional client support. See microsoft/vscode#134450 (comment).
Introducing the "lazy" flag affects only the presentation and is optional.

@puremourning
Copy link
Contributor

Oh I see. The suggestion is to keep the additional variable in the hierarchy, but add a hint to say "this is a fake variable to save evaluating it". Got it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants