Skip to content

Commit

Permalink
preLaunchTask should complete before resolveDebugConfigurationWithSub…
Browse files Browse the repository at this point in the history
…stitutedVariables

fixes #95162
  • Loading branch information
isidorn committed Aug 10, 2020
1 parent fb13eb1 commit 83b02fa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/vs/workbench/contrib/debug/browser/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@ export class DebugService implements IDebugService {
return false;
}

const workspace = launch?.workspace || this.contextService.getWorkspace();
const taskResult = await this.taskRunner.runTaskAndCheckErrors(workspace, resolvedConfig.preLaunchTask, (msg, actions) => this.showError(msg, actions));
if (taskResult === TaskRunResult.Failure) {
return false;
}

const cfg = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined, type, resolvedConfig, initCancellationToken.token);
if (!cfg) {
if (launch && type && cfg === null && !initCancellationToken.token.isCancellationRequested) { // show launch.json only for "config" being "null".
Expand All @@ -436,12 +442,7 @@ export class DebugService implements IDebugService {
return false;
}

const workspace = launch?.workspace || this.contextService.getWorkspace();
const taskResult = await this.taskRunner.runTaskAndCheckErrors(workspace, resolvedConfig.preLaunchTask, (msg, actions) => this.showError(msg, actions));
if (taskResult === TaskRunResult.Success) {
return this.doCreateSession(sessionId, launch?.workspace, { resolved: resolvedConfig, unresolved: unresolvedConfig }, options);
}
return false;
return this.doCreateSession(sessionId, launch?.workspace, { resolved: resolvedConfig, unresolved: unresolvedConfig }, options);
} catch (err) {
if (err && err.message) {
await this.showError(err.message);
Expand Down

0 comments on commit 83b02fa

Please sign in to comment.