mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 09:35:39 -05:00
Merge from vscode 718331d6f3ebd1b571530ab499edb266ddd493d5
This commit is contained in:
@@ -40,7 +40,7 @@ export interface IWorkspacesService {
|
||||
// History
|
||||
readonly onRecentlyOpenedChange: CommonEvent<void>;
|
||||
addRecentlyOpened(recents: IRecent[]): Promise<void>;
|
||||
removeFromRecentlyOpened(workspaces: URI[]): Promise<void>;
|
||||
removeRecentlyOpened(workspaces: URI[]): Promise<void>;
|
||||
clearRecentlyOpened(): Promise<void>;
|
||||
getRecentlyOpened(): Promise<IRecentlyOpened>;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export interface IWorkspacesHistoryMainService {
|
||||
|
||||
addRecentlyOpened(recents: IRecent[]): void;
|
||||
getRecentlyOpened(currentWorkspace?: IWorkspaceIdentifier, currentFolder?: ISingleFolderWorkspaceIdentifier, currentFiles?: IPath[]): IRecentlyOpened;
|
||||
removeFromRecentlyOpened(paths: URI[]): void;
|
||||
removeRecentlyOpened(paths: URI[]): void;
|
||||
clearRecentlyOpened(): void;
|
||||
|
||||
updateWindowsJumpList(): void;
|
||||
@@ -148,7 +148,7 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
|
||||
}
|
||||
}
|
||||
|
||||
removeFromRecentlyOpened(toRemove: URI[]): void {
|
||||
removeRecentlyOpened(toRemove: URI[]): void {
|
||||
const keep = (recent: IRecent) => {
|
||||
const uri = location(recent);
|
||||
for (const r of toRemove) {
|
||||
@@ -344,7 +344,7 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
|
||||
}
|
||||
}
|
||||
}
|
||||
this.removeFromRecentlyOpened(toRemove);
|
||||
this.removeRecentlyOpened(toRemove);
|
||||
|
||||
// Add entries
|
||||
jumpList.push({
|
||||
|
||||
@@ -63,8 +63,8 @@ export class WorkspacesService implements AddFirstParameterToFunctions<IWorkspac
|
||||
return this.workspacesHistoryMainService.addRecentlyOpened(recents);
|
||||
}
|
||||
|
||||
async removeFromRecentlyOpened(windowId: number, paths: URI[]): Promise<void> {
|
||||
return this.workspacesHistoryMainService.removeFromRecentlyOpened(paths);
|
||||
async removeRecentlyOpened(windowId: number, paths: URI[]): Promise<void> {
|
||||
return this.workspacesHistoryMainService.removeRecentlyOpened(paths);
|
||||
}
|
||||
|
||||
async clearRecentlyOpened(windowId: number): Promise<void> {
|
||||
|
||||
@@ -11,14 +11,93 @@ import * as pfs from 'vs/base/node/pfs';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { WorkspacesMainService, IStoredWorkspace } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { WORKSPACE_EXTENSION, IRawFileWorkspaceFolder, IWorkspaceFolderCreationData, IRawUriWorkspaceFolder, rewriteWorkspaceFileForNewLocation } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { WORKSPACE_EXTENSION, IRawFileWorkspaceFolder, IWorkspaceFolderCreationData, IRawUriWorkspaceFolder, rewriteWorkspaceFileForNewLocation, IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { normalizeDriveLetter } from 'vs/base/common/labels';
|
||||
import { dirname, joinPath } from 'vs/base/common/resources';
|
||||
import { TestBackupMainService, TestDialogMainService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogs';
|
||||
import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs';
|
||||
import { IBackupMainService, IWorkspaceBackupInfo } from 'vs/platform/backup/electron-main/backup';
|
||||
import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup';
|
||||
|
||||
export class TestDialogMainService implements IDialogMainService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
pickFileFolder(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<string[] | undefined> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
pickFolder(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<string[] | undefined> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
pickFile(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<string[] | undefined> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
pickWorkspace(options: INativeOpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<string[] | undefined> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
showMessageBox(options: Electron.MessageBoxOptions, window?: Electron.BrowserWindow | undefined): Promise<Electron.MessageBoxReturnValue> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
showSaveDialog(options: Electron.SaveDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<Electron.SaveDialogReturnValue> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
showOpenDialog(options: Electron.OpenDialogOptions, window?: Electron.BrowserWindow | undefined): Promise<Electron.OpenDialogReturnValue> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
export class TestBackupMainService implements IBackupMainService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
isHotExitEnabled(): boolean {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
getWorkspaceBackups(): IWorkspaceBackupInfo[] {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
getFolderBackupPaths(): URI[] {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
getEmptyWindowBackupPaths(): IEmptyWindowBackupInfo[] {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
registerWorkspaceBackupSync(workspace: IWorkspaceBackupInfo, migrateFrom?: string | undefined): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
registerFolderBackupSync(folderUri: URI): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
registerEmptyWindowBackupSync(backupFolder?: string | undefined, remoteAuthority?: string | undefined): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
unregisterWorkspaceBackupSync(workspace: IWorkspaceIdentifier): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
unregisterFolderBackupSync(folderUri: URI): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
unregisterEmptyWindowBackupSync(backupFolder: string): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
suite('WorkspacesMainService', () => {
|
||||
const parentDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'workspacesservice');
|
||||
|
||||
Reference in New Issue
Block a user