mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 18:46:34 -05:00
Merge from vscode 9bc92b48d945144abb405b9e8df05e18accb9148
This commit is contained in:
@@ -89,6 +89,8 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
|
||||
import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel';
|
||||
import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService';
|
||||
import { Direction } from 'vs/base/browser/ui/grid/grid';
|
||||
import { IProgressService, IProgressOptions, IProgressWindowOptions, IProgressNotificationOptions, IProgressCompositeOptions, IProgress, IProgressStep, emptyProgress } from 'vs/platform/progress/common/progress';
|
||||
import { IWorkingCopyFileService, WorkingCopyFileService } from 'vs/workbench/services/workingCopy/common/workingCopyFileService';
|
||||
|
||||
export import TestTextResourcePropertiesService = CommonWorkbenchTestServices.TestTextResourcePropertiesService;
|
||||
export import TestContextService = CommonWorkbenchTestServices.TestContextService;
|
||||
@@ -120,7 +122,6 @@ export class TestTextFileService extends BrowserTextFileService {
|
||||
@IFilesConfigurationService filesConfigurationService: IFilesConfigurationService,
|
||||
@ITextModelService textModelService: ITextModelService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IRemotePathService remotePathService: IRemotePathService
|
||||
) {
|
||||
super(
|
||||
@@ -136,7 +137,6 @@ export class TestTextFileService extends BrowserTextFileService {
|
||||
filesConfigurationService,
|
||||
textModelService,
|
||||
codeEditorService,
|
||||
notificationService,
|
||||
remotePathService
|
||||
);
|
||||
}
|
||||
@@ -172,9 +172,11 @@ export const TestEnvironmentService = new BrowserWorkbenchEnvironmentService(Obj
|
||||
export function workbenchInstantiationService(overrides?: { textFileService?: (instantiationService: IInstantiationService) => ITextFileService }): ITestInstantiationService {
|
||||
const instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()]));
|
||||
|
||||
instantiationService.stub(IWorkingCopyService, new TestWorkingCopyService());
|
||||
instantiationService.stub(IEnvironmentService, TestEnvironmentService);
|
||||
const contextKeyService = <IContextKeyService>instantiationService.createInstance(MockContextKeyService);
|
||||
instantiationService.stub(IContextKeyService, contextKeyService);
|
||||
instantiationService.stub(IProgressService, new TestProgressService());
|
||||
const workspaceContextService = new TestContextService(TestWorkspace);
|
||||
instantiationService.stub(IWorkspaceContextService, workspaceContextService);
|
||||
const configService = new TestConfigurationService();
|
||||
@@ -200,6 +202,7 @@ export function workbenchInstantiationService(overrides?: { textFileService?: (i
|
||||
instantiationService.stub(IKeybindingService, new MockKeybindingService());
|
||||
instantiationService.stub(IDecorationsService, new TestDecorationsService());
|
||||
instantiationService.stub(IExtensionService, new TestExtensionService());
|
||||
instantiationService.stub(IWorkingCopyFileService, instantiationService.createInstance(WorkingCopyFileService));
|
||||
instantiationService.stub(ITextFileService, overrides?.textFileService ? overrides.textFileService(instantiationService) : <ITextFileService>instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(IHostService, <IHostService>instantiationService.createInstance(TestHostService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
@@ -212,11 +215,23 @@ export function workbenchInstantiationService(overrides?: { textFileService?: (i
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
instantiationService.stub(ICodeEditorService, new TestCodeEditorService());
|
||||
instantiationService.stub(IViewletService, new TestViewletService());
|
||||
instantiationService.stub(IWorkingCopyService, new TestWorkingCopyService());
|
||||
|
||||
return instantiationService;
|
||||
}
|
||||
|
||||
export class TestProgressService implements IProgressService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
withProgress(
|
||||
options: IProgressOptions | IProgressWindowOptions | IProgressNotificationOptions | IProgressCompositeOptions,
|
||||
task: (progress: IProgress<IProgressStep>) => Promise<any>,
|
||||
onDidCancel?: ((choice?: number | undefined) => void) | undefined
|
||||
): Promise<any> {
|
||||
return task(emptyProgress);
|
||||
}
|
||||
}
|
||||
|
||||
export class TestAccessibilityService implements IAccessibilityService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
@@ -588,8 +603,8 @@ export class TestFileService implements IFileService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private readonly _onFileChanges: Emitter<FileChangesEvent>;
|
||||
private readonly _onAfterOperation: Emitter<FileOperationEvent>;
|
||||
private readonly _onDidFilesChange = new Emitter<FileChangesEvent>();
|
||||
private readonly _onDidRunOperation = new Emitter<FileOperationEvent>();
|
||||
|
||||
readonly onWillActivateFileSystemProvider = Event.None;
|
||||
readonly onDidChangeFileSystemProviderCapabilities = Event.None;
|
||||
@@ -598,18 +613,13 @@ export class TestFileService implements IFileService {
|
||||
private content = 'Hello Html';
|
||||
private lastReadFileUri!: URI;
|
||||
|
||||
constructor() {
|
||||
this._onFileChanges = new Emitter<FileChangesEvent>();
|
||||
this._onAfterOperation = new Emitter<FileOperationEvent>();
|
||||
}
|
||||
|
||||
setContent(content: string): void { this.content = content; }
|
||||
getContent(): string { return this.content; }
|
||||
getLastReadFileUri(): URI { return this.lastReadFileUri; }
|
||||
get onFileChanges(): Event<FileChangesEvent> { return this._onFileChanges.event; }
|
||||
fireFileChanges(event: FileChangesEvent): void { this._onFileChanges.fire(event); }
|
||||
get onAfterOperation(): Event<FileOperationEvent> { return this._onAfterOperation.event; }
|
||||
fireAfterOperation(event: FileOperationEvent): void { this._onAfterOperation.fire(event); }
|
||||
get onDidFilesChange(): Event<FileChangesEvent> { return this._onDidFilesChange.event; }
|
||||
fireFileChanges(event: FileChangesEvent): void { this._onDidFilesChange.fire(event); }
|
||||
get onDidRunOperation(): Event<FileOperationEvent> { return this._onDidRunOperation.event; }
|
||||
fireAfterOperation(event: FileOperationEvent): void { this._onDidRunOperation.fire(event); }
|
||||
resolve(resource: URI, _options?: IResolveFileOptions): Promise<IFileStat>;
|
||||
resolve(resource: URI, _options: IResolveMetadataFileOptions): Promise<IFileStatWithMetadata>;
|
||||
resolve(resource: URI, _options?: IResolveFileOptions): Promise<IFileStat> {
|
||||
|
||||
Reference in New Issue
Block a user