mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 11:38:36 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -5,11 +5,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import 'vs/workbench/parts/files/browser/files.contribution'; // load our contribution into the test
|
||||
import 'vs/workbench/parts/files/electron-browser/files.contribution'; // load our contribution into the test
|
||||
import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput';
|
||||
import { Promise, TPromise } from 'vs/base/common/winjs.base';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
@@ -21,7 +20,7 @@ import Severity from 'vs/base/common/severity';
|
||||
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IPartService, Parts } from 'vs/workbench/services/part/common/partService';
|
||||
import { IPartService, Parts, Position as PartPosition, Dimension } from 'vs/workbench/services/part/common/partService';
|
||||
import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { IEditorInput, IEditorOptions, Position, Direction, IEditor, IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
@@ -46,7 +45,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi
|
||||
import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { IWindowsService, IWindowService, INativeOpenDialogOptions, IEnterWorkspaceResult, IMessageBoxResult } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowsService, IWindowService, INativeOpenDialogOptions, IEnterWorkspaceResult, IMessageBoxResult, IWindowConfiguration } from 'vs/platform/windows/common/windows';
|
||||
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { RawTextSource, IRawTextSource } from 'vs/editor/common/model/textSource';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
@@ -57,7 +56,7 @@ import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService
|
||||
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IRecentlyOpened } from 'vs/platform/history/common/history';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IPosition } from 'vs/editor/common/core/position';
|
||||
import { IPosition, Position as EditorPosition } from 'vs/editor/common/core/position';
|
||||
import { ICommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
|
||||
|
||||
@@ -71,7 +70,6 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private workspace: IWorkbenchWorkspace;
|
||||
private id: string;
|
||||
private options: any;
|
||||
|
||||
private _onDidChangeWorkspaceName: Emitter<void>;
|
||||
@@ -80,7 +78,6 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
|
||||
constructor(workspace: any = TestWorkspace, options: any = null) {
|
||||
this.workspace = workspace;
|
||||
this.id = generateUuid();
|
||||
this.options = options || Object.create(null);
|
||||
this._onDidChangeWorkspaceFolders = new Emitter<IWorkspaceFoldersChangeEvent>();
|
||||
this._onDidChangeWorkbenchState = new Emitter<WorkbenchState>();
|
||||
@@ -171,7 +168,6 @@ export class TestTextFileService extends TextFileService {
|
||||
@ILifecycleService lifecycleService: ILifecycleService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
|
||||
@IFileService fileService: IFileService,
|
||||
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
|
||||
@@ -181,7 +177,7 @@ export class TestTextFileService extends TextFileService {
|
||||
@IWindowsService windowsService: IWindowsService,
|
||||
@IHistoryService historyService: IHistoryService
|
||||
) {
|
||||
super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, TestEnvironmentService, backupFileService, windowsService, historyService);
|
||||
super(lifecycleService, contextService, configurationService, fileService, untitledEditorService, instantiationService, messageService, TestEnvironmentService, backupFileService, windowsService, historyService);
|
||||
}
|
||||
|
||||
public setPromptPath(path: string): void {
|
||||
@@ -218,7 +214,7 @@ export class TestTextFileService extends TextFileService {
|
||||
});
|
||||
}
|
||||
|
||||
public promptForPath(defaultPath?: string): string {
|
||||
public promptForPath(defaultPath: string): string {
|
||||
return this.promptPath;
|
||||
}
|
||||
|
||||
@@ -265,7 +261,7 @@ export function workbenchInstantiationService(): IInstantiationService {
|
||||
choose: (severity, message, options, cancelId): TPromise<number> => {
|
||||
return TPromise.as(cancelId);
|
||||
}
|
||||
});
|
||||
} as IChoiceService);
|
||||
|
||||
return instantiationService;
|
||||
}
|
||||
@@ -332,11 +328,11 @@ export class TestMessageService implements IMessageService {
|
||||
// No-op
|
||||
}
|
||||
|
||||
public confirmSync(confirmation: IConfirmation): boolean {
|
||||
public confirm(confirmation: IConfirmation): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
public confirm(confirmation: IConfirmation): Promise<IConfirmationResult> {
|
||||
public confirmWithCheckbox(confirmation: IConfirmation): Promise<IConfirmationResult> {
|
||||
return TPromise.as({ confirmed: false });
|
||||
}
|
||||
}
|
||||
@@ -346,13 +342,13 @@ export class TestPartService implements IPartService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _onTitleBarVisibilityChange = new Emitter<void>();
|
||||
private _onEditorLayout = new Emitter<void>();
|
||||
private _onEditorLayout = new Emitter<Dimension>();
|
||||
|
||||
public get onTitleBarVisibilityChange(): Event<void> {
|
||||
return this._onTitleBarVisibilityChange.event;
|
||||
}
|
||||
|
||||
public get onEditorLayout(): Event<void> {
|
||||
public get onEditorLayout(): Event<Dimension> {
|
||||
return this._onEditorLayout.event;
|
||||
}
|
||||
|
||||
@@ -362,19 +358,15 @@ export class TestPartService implements IPartService {
|
||||
return true;
|
||||
}
|
||||
|
||||
public joinCreation(): Promise {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public hasFocus(part): boolean {
|
||||
public hasFocus(part: Parts): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
public isVisible(part): boolean {
|
||||
public isVisible(part: Parts): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public getContainer(part): HTMLElement {
|
||||
public getContainer(part: Parts): HTMLElement {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -422,6 +414,10 @@ export class TestPartService implements IPartService {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public setPanelPosition(position: PartPosition): TPromise<void> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public addClass(clazz: string): void { }
|
||||
public removeClass(clazz: string): void { }
|
||||
public getWorkbenchElementId(): string { return ''; }
|
||||
@@ -431,14 +427,12 @@ export class TestPartService implements IPartService {
|
||||
public resizePart(part: Parts, sizeChange: number): void { }
|
||||
}
|
||||
|
||||
export class TestStorageService extends EventEmitter implements IStorageService {
|
||||
export class TestStorageService implements IStorageService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private storage: StorageService;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
let context = new TestContextService();
|
||||
this.storage = new StorageService(new InMemoryLocalStorage(), null, context.getWorkspace().id);
|
||||
}
|
||||
@@ -565,11 +559,6 @@ export class TestEditorGroupService implements IEditorGroupService {
|
||||
public pinEditor(arg1: any, input: IEditorInput): void {
|
||||
}
|
||||
|
||||
public unpinEditor(group: IEditorGroup, input: IEditorInput): void;
|
||||
public unpinEditor(position: Position, input: IEditorInput): void;
|
||||
public unpinEditor(arg1: any, input: IEditorInput): void {
|
||||
}
|
||||
|
||||
public moveEditor(input: IEditorInput, from: IEditorGroup, to: IEditorGroup, moveOptions?: IMoveOptions): void;
|
||||
public moveEditor(input: IEditorInput, from: Position, to: Position, moveOptions?: IMoveOptions): void;
|
||||
public moveEditor(input: IEditorInput, from: any, to: any, moveOptions?: IMoveOptions): void {
|
||||
@@ -603,11 +592,11 @@ export class TestEditorService implements IWorkbenchEditorService {
|
||||
this.mockLineNumber = 15;
|
||||
}
|
||||
|
||||
public openEditors(inputs): Promise {
|
||||
public openEditors(inputs: any[]): Promise {
|
||||
return TPromise.as([]);
|
||||
}
|
||||
|
||||
public replaceEditors(editors): TPromise<IEditor[]> {
|
||||
public replaceEditors(editors: any[]): TPromise<IEditor[]> {
|
||||
return TPromise.as([]);
|
||||
}
|
||||
|
||||
@@ -619,10 +608,6 @@ export class TestEditorService implements IWorkbenchEditorService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public isVisible(input: IEditorInput, includeDiff: boolean): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
public getActiveEditor(): IEditor {
|
||||
this.callback('getActiveEditor');
|
||||
|
||||
@@ -801,6 +786,10 @@ export class TestFileService implements IFileService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
canHandleResource(resource: URI): boolean {
|
||||
return resource.scheme === 'file';
|
||||
}
|
||||
|
||||
del(resource: URI, useTrash?: boolean): TPromise<void> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
@@ -880,7 +869,7 @@ export class TestBackupFileService implements IBackupFileService {
|
||||
public discardAllWorkspaceBackups(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class TestWindowService implements IWindowService {
|
||||
|
||||
@@ -892,6 +881,10 @@ export class TestWindowService implements IWindowService {
|
||||
return TPromise.as(false);
|
||||
}
|
||||
|
||||
getConfiguration(): IWindowConfiguration {
|
||||
return Object.create(null);
|
||||
}
|
||||
|
||||
getCurrentWindowId(): number {
|
||||
return 0;
|
||||
}
|
||||
@@ -960,18 +953,6 @@ export class TestWindowService implements IWindowService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
isMaximized(): TPromise<boolean> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
maximizeWindow(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
unmaximizeWindow(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
onWindowTitleDoubleClick(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
@@ -980,19 +961,19 @@ export class TestWindowService implements IWindowService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
showMessageBoxSync(options: Electron.MessageBoxOptions): number {
|
||||
showMessageBox(options: Electron.MessageBoxOptions): number {
|
||||
return 0;
|
||||
}
|
||||
|
||||
showMessageBox(options: Electron.MessageBoxOptions): Promise<IMessageBoxResult> {
|
||||
showMessageBoxWithCheckbox(options: Electron.MessageBoxOptions): Promise<IMessageBoxResult> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
showSaveDialog(options: Electron.SaveDialogOptions, callback?: (fileName: string) => void): string {
|
||||
showSaveDialog(options: Electron.SaveDialogOptions): string {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
showOpenDialog(options: Electron.OpenDialogOptions, callback?: (fileNames: string[]) => void): string[] {
|
||||
showOpenDialog(options: Electron.OpenDialogOptions): string[] {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
@@ -1008,10 +989,12 @@ export class TestLifecycleService implements ILifecycleService {
|
||||
public phase: LifecyclePhase;
|
||||
public startupKind: StartupKind;
|
||||
|
||||
private _onDidChangePhase = new Emitter<LifecyclePhase>();
|
||||
private _onWillShutdown = new Emitter<ShutdownEvent>();
|
||||
private _onShutdown = new Emitter<ShutdownReason>();
|
||||
|
||||
when(): Thenable<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
public fireShutdown(reason = ShutdownReason.QUIT): void {
|
||||
this._onShutdown.fire(reason);
|
||||
@@ -1021,10 +1004,6 @@ export class TestLifecycleService implements ILifecycleService {
|
||||
this._onWillShutdown.fire(event);
|
||||
}
|
||||
|
||||
public get onDidChangePhase(): Event<LifecyclePhase> {
|
||||
return this._onDidChangePhase.event;
|
||||
}
|
||||
|
||||
public get onWillShutdown(): Event<ShutdownEvent> {
|
||||
return this._onWillShutdown.event;
|
||||
}
|
||||
@@ -1232,11 +1211,10 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
|
||||
return { dispose() { } };
|
||||
}
|
||||
|
||||
public getConfiguration(resource: URI, section?: string): any;
|
||||
public getConfiguration(resource: URI, position?: IPosition, section?: string): any;
|
||||
public getConfiguration(resource: any, position?: any, section?: any): any;
|
||||
public getConfiguration(resource: any, position?: any, section?: any): any {
|
||||
return this.configurationService.getConfiguration(section, { resource });
|
||||
getValue<T>(resource: URI, arg2?: any, arg3?: any): T {
|
||||
const position: IPosition = EditorPosition.isIPosition(arg2) ? arg2 : null;
|
||||
const section: string = position ? (typeof arg3 === 'string' ? arg3 : void 0) : (typeof arg2 === 'string' ? arg2 : void 0);
|
||||
return this.configurationService.getValue(section, { resource });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1250,4 +1228,4 @@ export class TestHashService implements IHashService {
|
||||
|
||||
export function getRandomTestPath(tmpdir: string, ...segments: string[]): string {
|
||||
return paths.join(tmpdir, ...segments, generateUuid());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user