Open zobo opened 11 months ago
what should this look like?
we can easily evaluate a specific "node" at an offset: f.e. $reflector->reflectOffset($code, 12)->type()->__toString()
(e.g. $x<> = 1 + 2
will return 3
)
TextDocument inline value is used by IDE to get a list of variables that can be evaluated by the debugger for a range in the document.
These get displayed on the right side of the code when debugging.
How should it get the list of vars?
Sorry for the late reply, I'll try to be more exact. The Inline values request all evaluatable variables within a document section. The end result is something like this (random picture from SO):
So the command would return a list of variables in the document section that the debugger could evaluate in the current live debugger session. These are normally:
foreach
Again the LS does not EVALUATE them, it just reports the names (and ranges) for debugger to do the evaluation then.
Does this make more sense?
If the LS exposes the inline value capability, vscode allows the debugger to display those in the editor.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlineValue
This is already something I implemented and will port to this code-base when possible: https://github.com/zobo/php-language-server/pull/59