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

Debugger Hover #221503

Closed
kyriakosgeorgiades opened this issue Jul 11, 2024 · 18 comments
Closed

Debugger Hover #221503

kyriakosgeorgiades opened this issue Jul 11, 2024 · 18 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@kyriakosgeorgiades
Copy link

Type: Bug

When ever I use the debuger to hoover over variables to see the value it says undefiend most of the time even though is not, I can see the value on the top left "Variable" window, but it takes away the amazing feature you have that I can just hoover pleasee fix it!!!

VS Code version: Code 1.91.1 (f1e16e1, 2024-07-09T22:06:49.809Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 19.78GB (4.82GB free)
Process Argv --crash-reporter-id 9ec8d4bc-0830-4d7e-b834-f8b4da21afa5
Screen Reader no
VM 0%
Extensions (43)
Extension Author (truncated) Version
adb-qr Aak 0.2.0
better-comments aar 3.0.2
ng-template Ang 18.1.2
npm-intellisense chr 1.4.5
codeium Cod 1.8.80
codium Cod 0.9.4
dart-code Dar 3.92.0
flutter Dar 3.92.0
vscode-eslint dba 3.0.10
gitlens eam 15.2.0
prettier-vscode esb 10.4.0
discord-vscode icr 5.8.0
dotenv mik 1.0.1
mongodb-vscode mon 1.6.0
vscode-docker ms- 1.29.1
csharp ms- 2.34.12
vscode-dotnet-runtime ms- 2.0.8
debugpy ms- 2024.8.0
isort ms- 2023.10.1
python ms- 2024.10.0
vscode-pylance ms- 2024.7.1
jupyter ms- 2024.6.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.18
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.375.1
remote-ssh ms- 0.112.0
remote-ssh-edit ms- 0.86.0
remote-wsl ms- 0.88.2
remote-explorer ms- 0.4.3
material-icon-theme PKi 5.4.2
markdown-preview-enhanced shd 0.8.13
autoimport ste 1.5.4
move-ts str 1.12.0
tcv-typescript-constructor-generator toa 1.0.0
adb-interface-vscode vin 0.22.4
vscode-gradle vsc 3.14.1
vscode-icons vsc 12.8.0
volar Vue 2.0.10
JavaScriptSnippets xab 1.8.0
pretty-ts-errors Yoa 0.5.4
vscode-proto3 zxh 0.5.5
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
chatpanelc:31048052
dsvsc021:30996838
945dj816:31013170
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
legacy_priority:31082724
pythonrstrctxt:31093869

@szul
Copy link

szul commented Jul 16, 2024

Two of my employees are facing the same issue.

@ishansethitts
Copy link

Facing similar issue.

@john-p-timetabling
Copy link

Facing the same problem... just lost hours of work investigating a non-issue!

@roblourens
Copy link
Member

What language are you debugging?

@roblourens roblourens added the info-needed Issue requires more information from poster label Jul 24, 2024
@kyriakosgeorgiades
Copy link
Author

What language are you debugging?

Typescript

@szul
Copy link

szul commented Jul 25, 2024

What language are you debugging?

Typescript

Same.

@connor4312
Copy link
Member

Please share a code snippet where you see this happening, and let me know where you're hovering that's incorrectly showing as undefined. Thanks!

@connor4312
Copy link
Member

Logs would also be handy in addition to that if you're able to grab them:

/jsDebugLogs

@vscodenpa
Copy link

Please collect trace logs using the following instructions:

If you're able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.

⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to connor@xbox.com

@szul
Copy link

szul commented Jul 25, 2024

@ashishpat @yc5x Can either of you provide the above in regards to the hover debugging not working? Thanks.

@kyriakosgeorgiades
Copy link
Author

kyriakosgeorgiades commented Jul 25, 2024

Please share a code snippet where you see this happening, and let me know where you're hovering that's incorrectly showing as undefined. Thanks!

image

I will try to get JSDebugLogs later if that is okay
This is one example it happens for almsot every variable!

@yc5x
Copy link

yc5x commented Jul 25, 2024

here is what happened. When I step over line 55, mouse over decoded, it shows undefined, but at the left side local variable it shows value, same thing I stepped over line 56 for params, mouse over params, it shows undefined, then when I go to line 61, mouse over decoded, it shows value, however if I mouse over decoded on line 55, it is still undefined.
image

@ashishpat
Copy link

When hovering over GUID, it shows undefined, while the local variable and debug console both show the correct value.

image

image

vscode-debugadapter-cad11cbe.json.gz

@rbuzeta
Copy link

rbuzeta commented Jul 25, 2024

Same problem: Typescript, vscode 1.91.1, OS Windows

@connor4312
Copy link
Member

Could one of you share your tsconfig as well?

@ashishpat
Copy link

{
    "compilerOptions": {
        "target":"es6",
        "module": "commonjs",
	"declaration": false,
        "sourceMap": true,
        "outDir": "./dist",
        "rootDir": "./src",
        "skipLibCheck": true,
        "skipDefaultLibCheck": true,
        "resolveJsonModule": true,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "forceConsistentCasingInFileNames": true,
        "noImplicitReturns": true,
        "strict": true,
        "strictPropertyInitialization": false,
        "noUnusedLocals": true
    },
    "include": [
        "src/**/*"
    ],
}

connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Jul 25, 2024
I haven't been quite able to reproduce this, but this is the
explaination I see for microsoft/vscode#221503,
plausibly caused by sourcemap funkiness.

The root cause is that a hover evaluation's scope is being misidentified
as happening in a scope above the one it should actually run in. We then
saw this and thought we should hoist a variable, but don't find a
variable to hoist, and leave the replaced identifier in the expression.
If the scope were not misidentified, then the behavior would have been
identical because the variable would not be defined anyway.

In this PR we replace the identifier back to its original if we don't
find a variable to hoist, and also add logging to help any future
issues.
@connor4312
Copy link
Member

connor4312 commented Jul 25, 2024

Thanks, I have trouble reproducing this but I put in a fix for what I believe to be the cause. I would appreciate you trying it out by doing the following:

  1. Download and unzip js-debug-nightly.vsix.zip
  2. Open the extensions view (ctrl+shift+x) and search for @builtin @id:ms-vscode.js-debug
  3. Right click on the JavaScript Debugger extension and Disable it.
  4. Drag the unzipped .vsix file from step 1 into the extensions view to install it
  5. Reload the window / reopen VS Code and try debugging again

Or, wait for the normal nightly build in about 25 hours

connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Jul 26, 2024
I haven't been quite able to reproduce this, but this is the
explaination I see for microsoft/vscode#221503,
plausibly caused by sourcemap funkiness.

The root cause is that a hover evaluation's scope is being misidentified
as happening in a scope above the one it should actually run in. We then
saw this and thought we should hoist a variable, but don't find a
variable to hoist, and leave the replaced identifier in the expression.
If the scope were not misidentified, then the behavior would have been
identical because the variable would not be defined anyway.

In this PR we replace the identifier back to its original if we don't
find a variable to hoist, and also add logging to help any future
issues.
@ashishpat
Copy link

Yes, that works. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

10 participants