Skip to content

Commit

Permalink
fixes #18601
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Jan 16, 2017
1 parent 1a11270 commit 1a304fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/vs/workbench/parts/debug/electron-browser/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ export class DebugService implements debug.IDebugService {
const config = typeof configurationOrName === 'string' ? this.configurationManager.getConfiguration(configurationOrName) : configurationOrName;

return this.configurationManager.resloveConfiguration(config).then(resolvedConfig => {
if (!resolvedConfig) {
// User canceled resolving of interactive variables, silently return
return;
}

if (!this.configurationManager.getAdapter(resolvedConfig.type)) {
return resolvedConfig.type ? TPromise.wrapError(new Error(nls.localize('debugTypeNotSupported', "Configured debug type '{0}' is not supported.", resolvedConfig.type)))
: TPromise.wrapError(errors.create(nls.localize('debugTypeMissing', "Missing property 'type' for the chosen launch configuration."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
});
};
findInteractiveVariables(configuration);
let substitionCanceled = false;

const factory: { (): TPromise<any> }[] = Object.keys(interactiveVariablesToSubstitutes).map(interactiveVariable => {
return () => {
Expand All @@ -233,11 +234,13 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
interactiveVariablesToSubstitutes[interactiveVariable].forEach(substitute =>
substitute.object[substitute.key] = substitute.object[substitute.key].replace(`\${command.${interactiveVariable}}`, result)
);
} else {
substitionCanceled = true;
}
});
};
});

return sequence(factory).then(() => configuration);
return sequence(factory).then(() => substitionCanceled ? null : configuration);
}
}

0 comments on commit 1a304fe

Please sign in to comment.