mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 15:01:57 +01:00
files 💄
This commit is contained in:
@@ -30,7 +30,7 @@ import CommonEvent, { Emitter } from 'vs/base/common/event';
|
||||
import product from 'vs/platform/node/product';
|
||||
import { OpenContext } from 'vs/code/common/windows';
|
||||
import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { isParent, isEqual } from 'vs/platform/files/common/files';
|
||||
import { isParent, isEqual, isEqualOrParent } from 'vs/platform/files/common/files';
|
||||
|
||||
enum WindowError {
|
||||
UNRESPONSIVE,
|
||||
@@ -1113,7 +1113,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
}
|
||||
|
||||
// match on file path
|
||||
if (typeof w.openedWorkspacePath === 'string' && filePath && (isEqual(filePath, w.openedWorkspacePath) || isParent(filePath, w.openedWorkspacePath))) {
|
||||
if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +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/code/common/windows';
|
||||
import { isParent, isEqual } from 'vs/platform/files/common/files';
|
||||
import { isEqualOrParent } from 'vs/platform/files/common/files';
|
||||
|
||||
/**
|
||||
* Exported subset of VSCodeWindow for testing.
|
||||
@@ -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' && (isEqual(filePath, window.openedWorkspacePath) || isParent(filePath, window.openedWorkspacePath)));
|
||||
const containers = windows.filter(window => typeof window.openedWorkspacePath === 'string' && isEqualOrParent(filePath, window.openedWorkspacePath));
|
||||
if (containers.length) {
|
||||
return containers.sort((a, b) => -(a.openedWorkspacePath.length - b.openedWorkspacePath.length))[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user