Closed weinand closed 4 years ago
@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.
@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?
We have introduced an extension API proposal for hooking into the debug hover mechanism. See https://github.com/microsoft/vscode/issues/89084.
Since "evaluatable expression" are more more on the language side than the debugger side, I suggest that we continue the discussion in https://github.com/microsoft/vscode/issues/89084.
From @indiejames on July 3, 2016 1:59
DebugProtocol.EvaluateArguments
includes thecontext
which can behover
,watch
, orrepl
, 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