mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 04:53:33 +01:00
make single-folder case more explicit (rename workspacePath => folderPath)
This commit is contained in:
@@ -22,9 +22,9 @@ function options(custom?: Partial<IBestWindowOrFolderOptions<ISimpleWindow>>): I
|
||||
};
|
||||
}
|
||||
|
||||
const vscodeFolderWindow = { lastFocusTime: 1, openedWorkspacePath: path.join(fixturesFolder, 'vscode_folder') };
|
||||
const lastActiveWindow = { lastFocusTime: 3, openedWorkspacePath: null };
|
||||
const noVscodeFolderWindow = { lastFocusTime: 2, openedWorkspacePath: path.join(fixturesFolder, 'no_vscode_folder') };
|
||||
const vscodeFolderWindow = { lastFocusTime: 1, openedFolderPath: path.join(fixturesFolder, 'vscode_folder') };
|
||||
const lastActiveWindow = { lastFocusTime: 3, openedFolderPath: null };
|
||||
const noVscodeFolderWindow = { lastFocusTime: 2, openedFolderPath: path.join(fixturesFolder, 'no_vscode_folder') };
|
||||
const windows = [
|
||||
vscodeFolderWindow,
|
||||
lastActiveWindow,
|
||||
@@ -101,7 +101,7 @@ suite('WindowsFinder', () => {
|
||||
});
|
||||
|
||||
test('Existing window wins over vscode folder if more specific', () => {
|
||||
const window = { lastFocusTime: 1, openedWorkspacePath: path.join(fixturesFolder, 'vscode_folder', 'nested_folder') };
|
||||
const window = { lastFocusTime: 1, openedFolderPath: path.join(fixturesFolder, 'vscode_folder', 'nested_folder') };
|
||||
assert.equal(findBestWindowOrFolderForFile(options({
|
||||
windows: [window],
|
||||
filePath: path.join(fixturesFolder, 'vscode_folder', 'nested_folder', 'subfolder', 'file.txt')
|
||||
@@ -114,8 +114,8 @@ suite('WindowsFinder', () => {
|
||||
});
|
||||
|
||||
test('More specific existing window wins', () => {
|
||||
const window = { lastFocusTime: 2, openedWorkspacePath: path.join(fixturesFolder, 'no_vscode_folder') };
|
||||
const nestedFolderWindow = { lastFocusTime: 1, openedWorkspacePath: path.join(fixturesFolder, 'no_vscode_folder', 'nested_folder') };
|
||||
const window = { lastFocusTime: 2, openedFolderPath: path.join(fixturesFolder, 'no_vscode_folder') };
|
||||
const nestedFolderWindow = { lastFocusTime: 1, openedFolderPath: path.join(fixturesFolder, 'no_vscode_folder', 'nested_folder') };
|
||||
assert.equal(findBestWindowOrFolderForFile(options({
|
||||
windows: [window, nestedFolderWindow],
|
||||
filePath: path.join(fixturesFolder, 'no_vscode_folder', 'nested_folder', 'subfolder', 'file.txt')
|
||||
@@ -123,7 +123,7 @@ suite('WindowsFinder', () => {
|
||||
});
|
||||
|
||||
test('VSCode folder wins over existing window if more specific', () => {
|
||||
const window = { lastFocusTime: 1, openedWorkspacePath: path.join(fixturesFolder, 'vscode_folder') };
|
||||
const window = { lastFocusTime: 1, openedFolderPath: path.join(fixturesFolder, 'vscode_folder') };
|
||||
assert.equal(findBestWindowOrFolderForFile(options({
|
||||
windows: [window],
|
||||
filePath: path.join(fixturesFolder, 'vscode_folder', 'nested_vscode_folder', 'subfolder', 'file.txt')
|
||||
|
||||
Reference in New Issue
Block a user