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

Stepping through code with debugger not showing other file #68106

Closed
mitchellsimoens opened this issue Feb 7, 2019 · 10 comments
Closed

Stepping through code with debugger not showing other file #68106

mitchellsimoens opened this issue Feb 7, 2019 · 10 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@mitchellsimoens
Copy link

Issue Type: Bug

  1. Create a launch task like:
    {
      "type": "node",
      "request": "launch",
      "name": "[BE] Jest Current File",
      "program": "${workspaceFolder}/mydir/backend/node_modules/.bin/jest",
      "cwd": "${workspaceFolder}/mydir/backend",
      "args": ["${relativeFile}"],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    },
  1. Set a debugger; in a spec and run the launch config.

The debugger; is stopped in the file you have active but as you are stepping into code from another file a tab does not automatically open (or switch to that tab if it is already open) but the debug bar still allows you to step into things and seems to work as expected, just vscode doesn't show you where the debugger currently is. If you already have a tab open, if you switch to that tab the debugger is not showing any information of where the debugger is so you have no idea where the debugger is.

Since my example is using Jest, I am using version 24.0.0 but this was working just fine before this VSCode 1.31.0 release.

VS Code version: Code 1.31.0 (7c66f58, 2019-02-05T22:32:14.164Z)
OS version: Darwin x64 18.0.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 3
Memory (System) 16.00GB (0.60GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none
@vscodebot vscodebot bot added the new release label Feb 7, 2019
@mitchellsimoens
Copy link
Author

This is also happening if I run a node process (still jest) and then attach to it via

    {
      "type": "node",
      "request": "attach",
      "name": "Attach by Process ID",
      "processId": "${command:PickProcess}"
    },

@roblourens
Copy link
Member

Does the callstack show up? It might help if you include a screenshot just to be totally clear about the state that the UI is in.

@mitchellsimoens
Copy link
Author

Sure, here is a zipped mp4 (zipped gif was over 10MB limit still) even:

vscode_bug.mp4.zip

I disabled all extensions prior to recording this. The call stack does show up but the variables are blank. As I hit the step into button, it takes a couple till it jumps to the Table.js file.

@roblourens
Copy link
Member

Ok, so you click 'step in' and it doesn't open Table.js on the first step. You can see the row grayed out in the callstack. Could you set "trace": true, run it again, and post the log here?

@roblourens roblourens assigned roblourens and unassigned isidorn Feb 7, 2019
@roblourens roblourens added the info-needed Issue requires more information from poster label Feb 7, 2019
@mitchellsimoens
Copy link
Author

Maybe it's just jest but adding trace doesn't output anything extra:

    {
      "type": "node",
      "request": "attach",
      "name": "Attach by Process ID",
      "processId": "${command:PickProcess}",
      "trace": true
    },
    {
      "type": "node",
      "request": "launch",
      "name": "[BE] Jest Current File",
      "program": "${workspaceFolder}/mydir/backend/node_modules/.bin/jest",
      "cwd": "${workspaceFolder}/mydir/backend",
      "args": ["${relativeFile}"],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "trace": true
    },

I get this output either way:

cd /Users/mitchellsimoens/Public/project/mydir/backend ; /Users/mitchellsimoens/.nvm/versions/node/v11.6.0/bin/node --inspect-brk=9402 node_modules/.bin/jest mydir/backend/util/Table.test.js 
Debugger listening on ws://127.0.0.1:9402/558ac23f-ec8d-46f0-831e-f2923712131e
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
 PASS  util/Table.test.js (7.71s)
  util.Table
    createDate
      ○ skipped 1 test
    get
      ○ skipped 1 test
    put
      not versioned
        ○ skipped 3 tests
      versioned
        ✓ should put item with existing v0 item (6004ms)
        ○ skipped 2 tests

Test Suites: 1 passed, 1 total
Tests:       7 skipped, 1 passed, 8 total
Snapshots:   0 total
Time:        8.954s
Ran all test suites matching /mydir\/backend\/util\/Table.test.js/i.
Waiting for the debugger to disconnect...
[1]    46344 killed     /Users/mitchellsimoens/.nvm/versions/node/v11.6.0/bin/node --inspect-brk=9402

This is executing the jest bin that has #!/usr/bin/env node in it.

@roblourens
Copy link
Member

The log path will be in the debug consol

@roblourens
Copy link
Member

Or can you share the project? That would help too

@mitchellsimoens
Copy link
Author

My bad, here is the log: debugadapter.txt

@vscodebot vscodebot bot removed the new release label Feb 10, 2019
@roblourens
Copy link
Member

The log just shows that the problem happened but I can't tell why it happened, unfortunately. Can you share the project?

@vscodebot vscodebot bot closed this as completed Mar 8, 2019
@vscodebot
Copy link

vscodebot bot commented Mar 8, 2019

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 22, 2019
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

3 participants