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

Implement fully language-agnostic Evaluator #83

Closed
fwcd opened this issue Sep 2, 2020 · 3 comments · Fixed by #84
Closed

Implement fully language-agnostic Evaluator #83

fwcd opened this issue Sep 2, 2020 · 3 comments · Fixed by #84

Comments

@fwcd
Copy link
Contributor

fwcd commented Sep 2, 2020

Motivation

VSCode uses the Debug Adapter Protocol, which provides language-agnostic support for debugging, evaluating expressions and inspecting the object graph.

Question

Would it be possible to implement e.g. an Evaluator purely in terms of VSCode's DAP client, so that this extension could support any language with a debug adapter?

This would also fix issues like #63, #70, #79.

Proposed Solution

I have seen that there is a GenericEvaluator, which currently relies on parsing the evaluation response string. Many debug adapters provide more structured information about the result however, by including a variablesReference in the EvaluateResponse. Maybe it would be possible to use this to query the object's structure directly?

@hediet
Copy link
Owner

hediet commented Sep 2, 2020

Thanks for your thoughts!
However, I think I'm using the most language-agnostic way possible (which already includes leveraging the DAP).

I think data extractors cannot be implemented genericly, as they heavily rely on the semantics of the language and their data structures. I don't think the structured values of the DAP would help here. Can you further elaborate how you want to use the DAP information?

@fwcd
Copy link
Contributor Author

fwcd commented Sep 2, 2020

I'm testing this with my Kotlin debug adapter:

image

The debug adapter provides structural information about the objects referenced by each variable (e.g. a in this case), however not in direct a JSON format, but through DAP's variables API. My question is whether it would be possible for this extension to use the variables API to visualize the object graph directly, instead of trying to parse the evaluation response string (which, in Kotlin's case, is just "instance of ...") as JSON.

@fwcd
Copy link
Contributor Author

fwcd commented Sep 2, 2020

@hediet I have prototyped my idea in the PR #84.

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 a pull request may close this issue.

2 participants