mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
Merge from vscode 2e5312cd61ff99c570299ecc122c52584265eda2
This commit is contained in:
committed by
Anthony Dresser
parent
3603f55d97
commit
7f1d8fc32f
@@ -52,7 +52,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IDecorationsService, IResourceDecorationChangeEvent, IDecoration, IDecorationData, IDecorationsProvider } from 'vs/workbench/services/decorations/browser/decorations';
|
||||
import { IDisposable, toDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IEditorGroupsService, IEditorGroup, GroupsOrder, GroupsArrangement, GroupDirection, IAddGroupOptions, IMergeGroupOptions, IMoveEditorOptions, ICopyEditorOptions, IEditorReplacement, IGroupChangeEvent, IFindGroupScope, EditorGroupLayout, ICloseEditorOptions, GroupOrientation } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IEditorService, IOpenEditorOverrideHandler, ISaveEditorsOptions, IRevertAllEditorsOptions, IResourceEditorInputType, SIDE_GROUP_TYPE, ACTIVE_GROUP_TYPE } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorService, IOpenEditorOverrideHandler, ISaveEditorsOptions, IRevertAllEditorsOptions, IResourceEditorInputType, SIDE_GROUP_TYPE, ACTIVE_GROUP_TYPE, IOpenEditorOverrideEntry, ICustomEditorViewTypesHandler } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { IEditorRegistry, EditorDescriptor, Extensions } from 'vs/workbench/browser/editor';
|
||||
import { EditorGroup } from 'vs/workbench/common/editor/editorGroup';
|
||||
@@ -83,7 +83,7 @@ import { BrowserWorkbenchEnvironmentService } from 'vs/workbench/services/enviro
|
||||
import { BrowserTextFileService } from 'vs/workbench/services/textfile/browser/browserTextFileService';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel';
|
||||
import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService';
|
||||
import { IPathService } from 'vs/workbench/services/path/common/pathService';
|
||||
import { Direction } from 'vs/base/browser/ui/grid/grid';
|
||||
import { IProgressService, IProgressOptions, IProgressWindowOptions, IProgressNotificationOptions, IProgressCompositeOptions, IProgress, IProgressStep, Progress } from 'vs/platform/progress/common/progress';
|
||||
import { IWorkingCopyFileService, WorkingCopyFileService } from 'vs/workbench/services/workingCopy/common/workingCopyFileService';
|
||||
@@ -115,7 +115,10 @@ export interface ITestInstantiationService extends IInstantiationService {
|
||||
stub<T>(service: ServiceIdentifier<T>, ctor: any): T;
|
||||
}
|
||||
|
||||
export function workbenchInstantiationService(overrides?: { textFileService?: (instantiationService: IInstantiationService) => ITextFileService }): ITestInstantiationService {
|
||||
export function workbenchInstantiationService(overrides?: {
|
||||
textFileService?: (instantiationService: IInstantiationService) => ITextFileService
|
||||
pathService?: (instantiationService: IInstantiationService) => IPathService
|
||||
}): ITestInstantiationService {
|
||||
const instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()]));
|
||||
|
||||
instantiationService.stub(IWorkingCopyService, new TestWorkingCopyService());
|
||||
@@ -131,7 +134,7 @@ export function workbenchInstantiationService(overrides?: { textFileService?: (i
|
||||
instantiationService.stub(ITextResourceConfigurationService, new TestTextResourceConfigurationService(configService));
|
||||
instantiationService.stub(IUntitledTextEditorService, instantiationService.createInstance(UntitledTextEditorService));
|
||||
instantiationService.stub(IStorageService, new TestStorageService());
|
||||
instantiationService.stub(IRemotePathService, new TestRemotePathService(TestEnvironmentService));
|
||||
instantiationService.stub(IPathService, overrides?.pathService ? overrides.pathService(instantiationService) : new TestPathService());
|
||||
const layoutService = new TestLayoutService();
|
||||
instantiationService.stub(IWorkbenchLayoutService, layoutService);
|
||||
instantiationService.stub(IDialogService, new TestDialogService());
|
||||
@@ -214,7 +217,7 @@ export class TestTextFileService extends BrowserTextFileService {
|
||||
@IFilesConfigurationService filesConfigurationService: IFilesConfigurationService,
|
||||
@ITextModelService textModelService: ITextModelService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@IRemotePathService remotePathService: IRemotePathService,
|
||||
@IPathService pathService: IPathService,
|
||||
@IWorkingCopyFileService workingCopyFileService: IWorkingCopyFileService
|
||||
) {
|
||||
super(
|
||||
@@ -230,7 +233,7 @@ export class TestTextFileService extends BrowserTextFileService {
|
||||
filesConfigurationService,
|
||||
textModelService,
|
||||
codeEditorService,
|
||||
remotePathService,
|
||||
pathService,
|
||||
workingCopyFileService
|
||||
);
|
||||
}
|
||||
@@ -384,6 +387,7 @@ export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
|
||||
isRestored(): boolean { return true; }
|
||||
hasFocus(_part: Parts): boolean { return false; }
|
||||
focusPart(_part: Parts): void { }
|
||||
hasWindowBorder(): boolean { return false; }
|
||||
getWindowBorderRadius(): string | undefined { return undefined; }
|
||||
isVisible(_part: Parts): boolean { return true; }
|
||||
@@ -627,9 +631,12 @@ export class TestEditorService implements EditorServiceImpl {
|
||||
count = this.editors.length;
|
||||
|
||||
constructor(private editorGroupService?: IEditorGroupsService) { }
|
||||
|
||||
getEditors() { return []; }
|
||||
getEditorOverrides(editorInput: IEditorInput, options: IEditorOptions | undefined, group: IEditorGroup | undefined): [IOpenEditorOverrideHandler, IOpenEditorOverrideEntry][] { return []; }
|
||||
overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable { return toDisposable(() => undefined); }
|
||||
registerCustomEditorViewTypesHandler(source: string, handler: ICustomEditorViewTypesHandler): IDisposable {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<IEditorPane | undefined>;
|
||||
openEditor(editor: IResourceEditorInput | IUntitledTextResourceEditorInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<ITextEditorPane | undefined>;
|
||||
openEditor(editor: IResourceDiffEditorInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<ITextDiffEditorPane | undefined>;
|
||||
@@ -1033,7 +1040,7 @@ export class TestFileEditorInput extends EditorInput implements IFileEditorInput
|
||||
|
||||
getTypeId() { return this.typeId; }
|
||||
resolve(): Promise<IEditorModel | null> { return !this.fails ? Promise.resolve(null) : Promise.reject(new Error('fails')); }
|
||||
matches(other: TestEditorInput): boolean { return other && other.resource && this.resource.toString() === other.resource.toString() && other instanceof TestFileEditorInput && other.getTypeId() === this.typeId; }
|
||||
matches(other: EditorInput): boolean { return !!(other?.resource && this.resource.toString() === other.resource.toString() && other instanceof TestFileEditorInput && other.getTypeId() === this.typeId); }
|
||||
setEncoding(encoding: string) { }
|
||||
getEncoding() { return undefined; }
|
||||
setPreferredEncoding(encoding: string) { }
|
||||
@@ -1101,16 +1108,16 @@ export class TestListService implements IListService {
|
||||
}
|
||||
}
|
||||
|
||||
export class TestRemotePathService implements IRemotePathService {
|
||||
export class TestPathService implements IPathService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
constructor(@IWorkbenchEnvironmentService private readonly environmentService: IEnvironmentService) { }
|
||||
constructor(private readonly fallbackUserHome: URI = URI.from({ scheme: Schemas.vscodeRemote, path: '/' })) { }
|
||||
|
||||
get path() { return Promise.resolve(isWindows ? win32 : posix); }
|
||||
|
||||
get userHome() { return Promise.resolve(this.environmentService.userHome!); }
|
||||
get userHomeSync() { return this.environmentService.userHome; }
|
||||
get userHome() { return Promise.resolve(this.fallbackUserHome); }
|
||||
get resolvedUserHome() { return this.fallbackUserHome; }
|
||||
|
||||
async fileURI(path: string): Promise<URI> {
|
||||
return URI.file(path);
|
||||
|
||||
Reference in New Issue
Block a user