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

preLaunchTask does not fire on restart for "node" adapter #104246

Closed
osolo opened this issue Aug 7, 2020 · 18 comments
Closed

preLaunchTask does not fire on restart for "node" adapter #104246

osolo opened this issue Aug 7, 2020 · 18 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@osolo
Copy link

osolo commented Aug 7, 2020

  • VSCode Version: 1.47.3
  • OS Version: Windows 10 1909

Steps to Reproduce:

  1. Create an project that uses the node adapter. In my case I'm targeting Electron with Typescript.
  2. Add a preLaunchTask
  3. Run the application
  4. Edit one of the .ts files, introduce a syntax error
  5. Hit the Restart button on the toolbar or Ctrl+Shift+F5

Expected: Should complain about the syntax error.
Actual: Does not - reruns the app without executing the preLaunchTask.

I'm attaching a small sample project that demonstrates this problem: ts-test.zip

See also: #28979 which is an old, similar bug report. I don't know if this is a regression.

Does this issue occur when all extensions are disabled?: Yes. This happens on a fresh install.

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 7, 2020
@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

Works for me with latest VS Code insiders

Screenshot 2020-08-10 at 10 59 35

@osolo can you repro using latest vscode insiders https://code.visualstudio.com/insiders/

@isidorn isidorn added the info-needed Issue requires more information from poster label Aug 10, 2020
@OzSolomon-MSFT
Copy link

@isidorn yes, I can repro this with the insiders build. What can I do to provide more information?

@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

It would be great to have a minimal possible repository which reproduces this. So we can just clone it from GitHub and see it repro on our machines.

@OzSolomon-MSFT
Copy link

@isidorn did you use the zipped sample project I attached to the but report? It's very basic. All you need to do is unzip it and run npm install.

@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

I tried with that sample and I can not reproduce the issue. Let me know what you are doing differently:

recording (2)

@OzSolomon-MSFT
Copy link

@isidorn I'm doing the exact same as you:

2020-08-10_10-06-44

@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

Do you have the following setting set?

"debug.onTaskErrors": "debugAnyway" 

@OzSolomon-MSFT
Copy link

This is a fresh install. My user settings file is empty.

The default settings file has "debug.onTaskErrors": "prompt", so I'm assuming that's in effect.

@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

Then I suggest you F1 > developer tools > sources > put a breakpoint around here and try to investigate
Idealy the runTasks should get called.

Also you can try to reproduce with a very plain typescript sample, for exaple vscode starter extension.

@OzSolomon-MSFT
Copy link

It looks like inside restartSession the debugging session configuration is missing the preLaunchTask:

image

image

The session seems different than the one that is created in doCreateSession:

image

Does this help?

@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

Yeah, this helps. THanks a lot

@connor4312 can you change that you pass the preLaunchTask to child sessions? So when user restarts a child session this case is covered?
I am not sure why I can not repro this on the macOS.

@isidorn isidorn added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Aug 10, 2020
@connor4312
Copy link
Member

connor4312 commented Aug 10, 2020

Indeed, this is the same as #102296.

Thanks for reporting the issue, it should be fixed in 1.48.0 later this week (and is already fixed on VS Code Insiders). That's probably why you can't reproduce it, Isi :)

/duplicate

@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

@connor4312 hmm but the user says that he can reproduce with insiders - that is what got me confuse, since I knew you fixed something in this area that is why I first asked for repro in insiders.

@connor4312
Copy link
Member

Ah, okay, I missed that. @OzSolomon-MSFT can you set trace: true in your launch.json and share the resulting log (its location will be written in your debug console). That will help us see what's happening.

@connor4312 connor4312 reopened this Aug 10, 2020
@OzSolomon-MSFT
Copy link

@connor4312 please find attached.
vscode-debugadapter-0.json.gz

@connor4312
Copy link
Member

Ah, got it, thanks 🙂 We weren't passing the tasks down to deeply nested children.

@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug and removed *duplicate Issue identified as a duplicate of another issue(s) under-discussion Issue is under discussion for relevance, priority, approach labels Aug 10, 2020
@isidorn
Copy link
Contributor

isidorn commented Aug 10, 2020

Great, thanks for fixing.
@OzSolomon-MSFT thanks for provoding all teh details.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

6 participants
@osolo @weinand @isidorn @connor4312 @OzSolomon-MSFT and others