revert back to old path handling (for #12448)

This commit is contained in:
Benjamin Pasero
2017-03-21 06:33:44 -07:00
parent 030f2c5ef8
commit 7583abec86
32 changed files with 184 additions and 283 deletions

View File

@@ -234,8 +234,8 @@ export class WindowsManager implements IWindowsMainService {
// Send to windows
if (target) {
const otherWindowsWithTarget = WindowsManager.WINDOWS.filter(w => w.id !== windowId && typeof w.openedWorkspacePath === 'string');
const directTargetMatch = otherWindowsWithTarget.filter(w => isEqual(target, w.openedWorkspacePath));
const parentTargetMatch = otherWindowsWithTarget.filter(w => isParent(target, w.openedWorkspacePath));
const directTargetMatch = otherWindowsWithTarget.filter(w => isEqual(target, w.openedWorkspacePath, !platform.isLinux /* ignorecase */));
const parentTargetMatch = otherWindowsWithTarget.filter(w => isParent(target, w.openedWorkspacePath, !platform.isLinux /* ignorecase */));
const targetWindow = directTargetMatch.length ? directTargetMatch[0] : parentTargetMatch[0]; // prefer direct match over parent match
if (targetWindow) {
@@ -317,7 +317,7 @@ export class WindowsManager implements IWindowsMainService {
// Any non extension host window with same workspace
else if (!win.isExtensionDevelopmentHost && !!win.openedWorkspacePath) {
this.windowsState.openedFolders.forEach(o => {
if (isEqual(o.workspacePath, win.openedWorkspacePath)) {
if (isEqual(o.workspacePath, win.openedWorkspacePath, !platform.isLinux /* ignorecase */)) {
o.uiState = state.uiState;
}
});
@@ -510,7 +510,7 @@ export class WindowsManager implements IWindowsMainService {
// Open remaining ones
allFoldersToOpen.forEach(folderToOpen => {
if (windowsOnWorkspacePath.some(win => isEqual(win.openedWorkspacePath, folderToOpen))) {
if (windowsOnWorkspacePath.some(win => isEqual(win.openedWorkspacePath, folderToOpen, !platform.isLinux /* ignorecase */))) {
return; // ignore folders that are already open
}
@@ -684,7 +684,7 @@ export class WindowsManager implements IWindowsMainService {
// Reload an existing extension development host window on the same path
// We currently do not allow more than one extension development window
// on the same extension path.
let res = WindowsManager.WINDOWS.filter(w => w.config && isEqual(w.config.extensionDevelopmentPath, openConfig.cli.extensionDevelopmentPath));
let res = WindowsManager.WINDOWS.filter(w => w.config && isEqual(w.config.extensionDevelopmentPath, openConfig.cli.extensionDevelopmentPath, !platform.isLinux /* ignorecase */));
if (res && res.length === 1) {
this.reload(res[0], openConfig.cli);
res[0].focus(); // make sure it gets focus and is restored
@@ -906,7 +906,7 @@ export class WindowsManager implements IWindowsMainService {
// Known Folder - load from stored settings if any
if (configuration.workspacePath) {
const stateForWorkspace = this.windowsState.openedFolders.filter(o => isEqual(o.workspacePath, configuration.workspacePath)).map(o => o.uiState);
const stateForWorkspace = this.windowsState.openedFolders.filter(o => isEqual(o.workspacePath, configuration.workspacePath, !platform.isLinux /* ignorecase */)).map(o => o.uiState);
if (stateForWorkspace.length) {
return stateForWorkspace[0];
}
@@ -1103,22 +1103,22 @@ export class WindowsManager implements IWindowsMainService {
const res = windowsToTest.filter(w => {
// match on workspace
if (typeof w.openedWorkspacePath === 'string' && (isEqual(w.openedWorkspacePath, workspacePath))) {
if (typeof w.openedWorkspacePath === 'string' && (isEqual(w.openedWorkspacePath, workspacePath, !platform.isLinux /* ignorecase */))) {
return true;
}
// match on file
if (typeof w.openedFilePath === 'string' && isEqual(w.openedFilePath, filePath)) {
if (typeof w.openedFilePath === 'string' && isEqual(w.openedFilePath, filePath, !platform.isLinux /* ignorecase */)) {
return true;
}
// match on file path
if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath)) {
if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)) {
return true;
}
// match on extension development path
if (typeof extensionDevelopmentPath === 'string' && w.extensionDevelopmentPath === extensionDevelopmentPath) {
if (typeof extensionDevelopmentPath === 'string' && isEqual(w.extensionDevelopmentPath, extensionDevelopmentPath, !platform.isLinux /* ignorecase */)) {
return true;
}

View File

@@ -47,7 +47,7 @@ export function findBestWindowOrFolder<SimpleWindow extends ISimpleWindow>({ win
}
function findBestWindow<WINDOW extends ISimpleWindow>(windows: WINDOW[], filePath: string): WINDOW {
const containers = windows.filter(window => typeof window.openedWorkspacePath === 'string' && isEqualOrParent(filePath, window.openedWorkspacePath));
const containers = windows.filter(window => typeof window.openedWorkspacePath === 'string' && isEqualOrParent(filePath, window.openedWorkspacePath, !platform.isLinux /* ignorecase */));
if (containers.length) {
return containers.sort((a, b) => -(a.openedWorkspacePath.length - b.openedWorkspacePath.length))[0];
}