-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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 when adapter supportsRestartRequest #28979
Comments
Works for me, restart will always trigger |
Sorry i need to further qualify this issue. This is using the chrome debugger. "configurations": [{
"type": "chrome",
"request": "launch",
"preLaunchTask": "Build",
"name": "Launch Chrome against localhost",
"url": "https://j2017.censored.com/censored/web/index.html",
"webRoot": "${workspaceRoot}"
} |
That is because the chrome debuggers is using a custom restart feature. When a debug adapter is using this capability it is fully in charge what the restart exeprience should be like. So vscode does not do anything (including restarting the task). We currently do not support a half baked approach, where chrome would do some things in the restart and vscode the rest. Leaving this open as a feature request Ping @roblourens to also get his opinion |
I think it should act the same as when running without |
I thought maybe there was another issue for this where we discussed it, but I can't find it. I don't think it would be possible for the debug extension to implement this. |
@roblourens yes I agree what would be the ideal solution, however as mentioned above due to the current implentation we are not doing that yet (running a prelaucnh task and starting a new debug session are coupled). |
@isidorn When running a if (session.configuration.postDebugTask) {
this.runTask(session.getId(), session.raw.root, session.configuration.postDebugTask).done(undefined, err =>
this.notificationService.error(err)
);
} For
In the "supportsRestartRequest == true" case there is no check for
Why this discrepancy? Since the "supportsRestartRequest" is really an implementation detail of a debug adapter, an end user should not be able to observe any discernible difference between DAs supporting "supportsRestartRequest" and those that do not. I suggest that you refactor the pre- and post-launch code in two separate methods to ensure that the same code is run in both cases. |
I still see the |
That every time you restart the preLauncTask fires, if that is not the case please reopen and assign to July |
It works with the Node adapter, but not with the Chrome adapter. My launches: {
"type": "node",
"request": "launch",
"name": "runawhile.js",
"program": "${workspaceFolder}/runawhile.js",
"preLaunchTask": "npm: hello1",
"postDebugTask": "npm: hello2",
},
{
"type": "chrome",
"request": "launch",
"name": "Chrome server.js",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/wwwroot",
"preLaunchTask": "npm: hello1",
"postDebugTask": "npm: hello2",
}, |
@chrmarti good catch |
Steps to Reproduce:
Maybe we need a "preRestartTask"
The text was updated successfully, but these errors were encountered: