mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Merge from vscode 1fbacccbc900bb59ba8a8f26a4128d48a1c97842
This commit is contained in:
@@ -28,6 +28,7 @@ import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/u
|
||||
import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/untitledQueryEditorInput';
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { NotebookServiceStub } from 'sql/workbench/contrib/notebook/test/stubs';
|
||||
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
|
||||
|
||||
const languageAssociations = Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.LanguageAssociations);
|
||||
|
||||
@@ -122,7 +123,10 @@ suite('Editor Replacer Contribution', () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(UntitledTextEditorInput, URI.file('/test/file'), false, undefined, undefined, undefined);
|
||||
const accessor = instantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
|
||||
const input = instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
@@ -137,7 +141,9 @@ suite('Editor Replacer Contribution', () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const untitled = instantiationService.createInstance(UntitledTextEditorInput, URI.file('/test/file'), false, undefined, undefined, undefined);
|
||||
const accessor = instantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const untitled = instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
const input = instantiationService.createInstance(UntitledQueryEditorInput, '', untitled, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response === undefined);
|
||||
@@ -150,7 +156,9 @@ suite('Editor Replacer Contribution', () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(UntitledTextEditorInput, URI.file('/test/file.unknown'), false, undefined, undefined, undefined);
|
||||
const accessor = instantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const input = instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response === undefined);
|
||||
|
||||
@@ -254,3 +262,9 @@ class TestModeService implements IModeService {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
class ServiceAccessor {
|
||||
constructor(
|
||||
@IUntitledTextEditorService public readonly untitledTextEditorService: IUntitledTextEditorService
|
||||
) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user