提交 a6c8b82c 编写于 作者: I isidor

debug: compound configuration name error handling

上级 b173ec7e
......@@ -698,10 +698,16 @@ export class DebugService implements debug.IDebugService {
return TPromise.as(null);
}
let rootForName = root;
let rootForName: IWorkspaceFolder;
const launchesContainingName = this.configurationManager.getLaunches().filter(l => !!l.getConfiguration(name));
if (launchesContainingName && launchesContainingName.length === 1) {
if (launchesContainingName.length === 1) {
rootForName = launchesContainingName[0].workspace;
} else if (launchesContainingName.length > 1 && launchesContainingName.indexOf(launch) >= 0) {
// If there are multiple launches containing the configuration give priority to the configuration in the current launch
rootForName = launch.workspace;
} else {
return TPromise.wrapError(new Error(launchesContainingName.length === 0 ? nls.localize('noConfigurationNameInWorkspace', "Could not find launch configuration '{0}' in the workspace.", name)
: nls.localize('multipleConfigurationNamesInWorkspace', "There are multiple launch configurates `{0}` in the workspace. Use folder name to qualify the configuration.", name)));
}
return this.startDebugging(rootForName, name, noDebug, topCompoundName || compound.name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册