enable EH debugging for multi root workspaces (workaround for #30698)

This commit is contained in:
Benjamin Pasero
2017-07-14 13:52:37 +02:00
parent 418be9f1a8
commit 5589604823
5 changed files with 13 additions and 43 deletions
+1 -22
View File
@@ -10,8 +10,7 @@ import * as fs from 'fs';
import * as platform from 'vs/base/common/platform';
import * as paths from 'vs/base/common/paths';
import { OpenContext } from 'vs/platform/windows/common/windows';
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from "vs/platform/workspaces/common/workspaces";
import { isParent } from "vs/platform/files/common/files";
import { IWorkspaceIdentifier } from "vs/platform/workspaces/common/workspaces";
export interface ISimpleWindow {
openedWorkspace?: IWorkspaceIdentifier;
@@ -166,24 +165,4 @@ export function findExtensionDevelopmentWindow<W extends ISimpleWindow>(windows:
}
return null;
}
export function findWindowOnWorkspaceOrFolder<W extends ISimpleWindow>(windows: W[], target: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): W {
const directTargetMatch = windows.filter(w => {
if (typeof target === 'string') {
return paths.isEqual(target, w.openedFolderPath, !platform.isLinux /* ignorecase */);
}
return w.openedWorkspace && w.openedWorkspace.id === target.id;
});
const parentTargetMatch = windows.filter(w => {
if (typeof target === 'string') {
return isParent(target, w.openedFolderPath, !platform.isLinux /* ignorecase */);
}
return false; // not supported for workspace target
});
return directTargetMatch.length ? directTargetMatch[0] : parentTargetMatch[0]; // prefer direct match over parent match
}