-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Hovers are not shown correctly for duplicate variables in a block #16632
Comments
This is coming from the node2 debug adapter. Assigning first to @roblourens to investigate |
Here is a different variation of @sandy081's issue. Before the shadowing variable is introduced the line shows the outer-scope value. That makes sense since the debugger doesn't really look ahead. Once the shadowing variable is introduced no value is show for it. |
Two problems, first the scope locations are not sourcemapped, which is my mistake. I'll fix it today, tracked here - microsoft/vscode-chrome-debug-core#141 But even when I fix that, this line causes an issue - https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/debugHover.ts#L216 - it finds both variables, but they have different values, so the hover isn't shown. I'm not sure why that check exists? I think the first one should always take precedence if the scopes are in the right order. |
@roblourens that check exists for all the other debug adapters that do not have the scope range information. Shouldn't this line take care of duplicate scopes? Thus only the scope with the correct range will be left? First one taking precedence would potentially show the wrong debug hover value for other adapters, thus we decided it is better to now show any value at all. |
The scopes are nested, so all the scopes contain the expression. |
Then that line needs to be improved in order to find the most specific scope. E.g smallest scope that containes the current line. |
January is fine with me |
The original issue is verified. There's still a related problem which I think we can't do anything about. This is even easier to see with inline debug values. On |
Testing #15359
See the following snippet
While debugging inside the block where
object
is defined again. Hovering on it is not giving correct value. After coming out of the block, allobject
hovers are showing the value returned bysomeFunction()
. See the videoThe text was updated successfully, but these errors were encountered: