提交 69ae7780 编写于 作者: B Benjamin Pasero

always use default window state when running extension tests

上级 b412ba96
......@@ -987,41 +987,45 @@ export class WindowsManager implements IWindowsMainService {
}
private getNewWindowState(configuration: IWindowConfiguration): INewWindowState {
const lastActive = this.getLastActiveWindow();
// extension development host Window - load from stored settings if any
if (!!configuration.extensionDevelopmentPath && this.windowsState.lastPluginDevelopmentHostWindow) {
return this.windowsState.lastPluginDevelopmentHostWindow.uiState;
}
// Restore state unless we are running extension tests
if (!configuration.extensionTestsPath) {
// Known Workspace - load from stored settings
if (configuration.workspace) {
const stateForWorkspace = this.windowsState.openedWindows.filter(o => o.workspace && o.workspace.id === configuration.workspace.id).map(o => o.uiState);
if (stateForWorkspace.length) {
return stateForWorkspace[0];
// extension development host Window - load from stored settings if any
if (!!configuration.extensionDevelopmentPath && this.windowsState.lastPluginDevelopmentHostWindow) {
return this.windowsState.lastPluginDevelopmentHostWindow.uiState;
}
}
// Known Folder - load from stored settings
if (configuration.folderPath) {
const stateForFolder = this.windowsState.openedWindows.filter(o => isEqual(o.folderPath, configuration.folderPath, !isLinux /* ignorecase */)).map(o => o.uiState);
if (stateForFolder.length) {
return stateForFolder[0];
// Known Workspace - load from stored settings
if (configuration.workspace) {
const stateForWorkspace = this.windowsState.openedWindows.filter(o => o.workspace && o.workspace.id === configuration.workspace.id).map(o => o.uiState);
if (stateForWorkspace.length) {
return stateForWorkspace[0];
}
}
// Known Folder - load from stored settings
if (configuration.folderPath) {
const stateForFolder = this.windowsState.openedWindows.filter(o => isEqual(o.folderPath, configuration.folderPath, !isLinux /* ignorecase */)).map(o => o.uiState);
if (stateForFolder.length) {
return stateForFolder[0];
}
}
}
// Empty windows with backups
else if (configuration.backupPath) {
const stateForEmptyWindow = this.windowsState.openedWindows.filter(o => o.backupPath === configuration.backupPath).map(o => o.uiState);
if (stateForEmptyWindow.length) {
return stateForEmptyWindow[0];
// Empty windows with backups
else if (configuration.backupPath) {
const stateForEmptyWindow = this.windowsState.openedWindows.filter(o => o.backupPath === configuration.backupPath).map(o => o.uiState);
if (stateForEmptyWindow.length) {
return stateForEmptyWindow[0];
}
}
}
// First Window
const lastActive = this.getLastActiveWindow();
const lastActiveState = this.lastClosedWindowState || this.windowsState.lastActiveWindow;
if (!lastActive && lastActiveState) {
return lastActiveState.uiState;
// First Window
const lastActiveState = this.lastClosedWindowState || this.windowsState.lastActiveWindow;
if (!lastActive && lastActiveState) {
return lastActiveState.uiState;
}
}
//
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册