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 additional context to debug adapter evaluateRequest calls. #137

Closed
weinand opened this issue Nov 13, 2017 · 3 comments
Closed

Add additional context to debug adapter evaluateRequest calls. #137

weinand opened this issue Nov 13, 2017 · 3 comments
Assignees
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Nov 13, 2017

From @indiejames on July 3, 2016 1:59

DebugProtocol.EvaluateArguments includes the context which can be hover, watch, or repl, but it would be helpful to (optionally) include additional context. In particular, for Clojure, the namespace in which the code is being evaluated is pertinent. A brute force way of passing on useful context would be to pass the text of the document in which the code is being executed if it is executed from a selection inside an editor.

A more general approach would be to let an extension register a context generator function that gets passed the editor (to determine the selected text) and returns the EvaluateArguments object to be passed to the debug adapter. In this way the generator could limit the contextual information to only what is required (like the enclosing namespace in the case of Clojure). This would also allow the generator to expend the selection to an enclosing form, etc.

Copied from original issue: microsoft/vscode#8686

@weinand weinand self-assigned this Nov 13, 2017
@weinand weinand added debug feature-request Request for new features or functionality labels Nov 13, 2017
@weinand weinand added protocol change and removed debug feature-request Request for new features or functionality labels Nov 13, 2017
@weinand weinand added this to the On Deck milestone Nov 20, 2017
@kalberes
Copy link

kalberes commented Sep 2, 2019

@weinand

I would also like to request for the extra context that in case of a hover evaluation the position of the hovered text is also passed along. Similar as the texdocument/hover for the language server.
Without this, in certain scenarios it is impossible in the AL language Debug Adapter to unambiguously evaluate a variable.
In the AL language it is frequent that we deal with quoted identifiers. These are table fields. Example: "Production Forecast Name". Now if one hovers over Name for example we only get the "Name" as expression to evaluate.
In general to find the correct context for a hover evaluation we would need to find the symbol at the position, fully qualify it and evaluate its runtime value. For this we need the positions of the expression to evaluate.

@kalberes
Copy link

@weinand.
Any follow up. Would it been possible that the EvaluateArguments contain the position(range) of the expression in case of a hover similar to the language server protocol's hover request?

@weinand
Copy link
Contributor Author

weinand commented Feb 14, 2020

We have introduced an extension API proposal for hooking into the debug hover mechanism.
See microsoft/vscode#89084.

Since "evaluatable expression" are more more on the language side than the debugger side, I suggest that we continue the discussion in microsoft/vscode#89084.

@weinand weinand closed this as completed Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants