-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Problem:
An existing problem is that the 'hover' variant of the evaluate request doesn't contain enough information to distinguish between shadowed variables. Consider the following example:
std::string x = "foo" # line A
if(condition) {
std::string x = "bar" # line B
do_something(x); # <- currently stopped here
}
If a hover evaluate request for the x
in line B
is issued, then the debugger will be able to show its correct value ("bar"
) because that x
corresponds to the current frame. However, if the hover happens for the x
in line A
, the debugger will return "bar"
instead of "foo"
, just because it doesn't know which x
the request is for.
Proposed solution
Include an optional Location
attribute, similar to the one used by LSP, in EvaluateArguments
for hover
.
The debugger might be able to easily distinguish shadowed variables using this information, as it knows the location of the declarations of each variable.