mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 09:35:37 -05:00
Merge vscode source through 1.62 release (#19981)
* Build breaks 1 * Build breaks * Build breaks * Build breaks * More build breaks * Build breaks (#2512) * Runtime breaks * Build breaks * Fix dialog location break * Update typescript * Fix ASAR break issue * Unit test breaks * Update distro * Fix breaks in ADO builds (#2513) * Bump to node 16 * Fix hygiene errors * Bump distro * Remove reference to node type * Delete vscode specific extension * Bump to node 16 in CI yaml * Skip integration tests in CI builds (while fixing) * yarn.lock update * Bump moment dependency in remote yarn * Fix drop-down chevron style * Bump to node 16 * Remove playwrite from ci.yaml * Skip building build scripts in hygine check
This commit is contained in:
@@ -18,11 +18,6 @@ import { ILanguageAssociationRegistry, Extensions as LanguageAssociationExtensio
|
||||
import { TestQueryEditorService } from 'sql/workbench/services/queryEditor/test/browser/testQueryEditorService';
|
||||
import { ITestInstantiationService, TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { NotebookServiceStub } from 'sql/workbench/contrib/notebook/test/stubs';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IUntitledTextResourceEditorInput, IVisibleEditorPane } from 'vs/workbench/common/editor';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
|
||||
import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/fileEditorInput';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { FileQueryEditorInput } from 'sql/workbench/contrib/query/browser/fileQueryEditorInput';
|
||||
@@ -32,6 +27,7 @@ import { EditorType } from 'vs/editor/common/editorCommon';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { IVisibleEditorPane } from 'vs/workbench/common/editor';
|
||||
|
||||
const languageAssociations = Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.LanguageAssociations);
|
||||
|
||||
@@ -48,7 +44,7 @@ suite('set mode', () => {
|
||||
disposables.push(languageAssociations.registerLanguageAssociation(NotebookEditorLanguageAssociation.languages, NotebookEditorLanguageAssociation));
|
||||
instantiationService = workbenchInstantiationService();
|
||||
instantiationService.stub(INotebookService, new NotebookServiceStub());
|
||||
const editorService = new MockEditorService(instantiationService);
|
||||
const editorService = new MockEditorService();
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
instantiationService.stub(IQueryEditorService, instantiationService.createInstance(TestQueryEditorService));
|
||||
instantiationService.invokeFunction(accessor => {
|
||||
@@ -61,7 +57,7 @@ suite('set mode', () => {
|
||||
});
|
||||
|
||||
test('does leave editor alone and change mode when changed from plaintext to json', async () => {
|
||||
const editorService = new MockEditorService(instantiationService, 'plaintext');
|
||||
const editorService = new MockEditorService('plaintext');
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const replaceEditorStub = sinon.stub(editorService, 'replaceEditors').callsFake(() => Promise.resolve());
|
||||
const stub = sinon.stub();
|
||||
@@ -75,7 +71,7 @@ suite('set mode', () => {
|
||||
|
||||
test('does replace editor and set mode correctly when changed from sql to notebooks', async () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
const editorService = new MockEditorService(instantiationService, 'sql');
|
||||
const editorService = new MockEditorService('sql');
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const stub = sinon.stub();
|
||||
const modeSupport = { setMode: stub };
|
||||
@@ -89,7 +85,7 @@ suite('set mode', () => {
|
||||
|
||||
test('does replace editor and set mode correctly when changed from sql to plaintext', async () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
const editorService = new MockEditorService(instantiationService, 'sql');
|
||||
const editorService = new MockEditorService('sql');
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const stub = sinon.stub();
|
||||
const modeSupport = { setMode: stub };
|
||||
@@ -103,7 +99,7 @@ suite('set mode', () => {
|
||||
|
||||
test('does replace editor and set mode correctly when changed from plaintext to sql', async () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
const editorService = new MockEditorService(instantiationService, 'plaintext');
|
||||
const editorService = new MockEditorService('plaintext');
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const stub = sinon.stub();
|
||||
const modeSupport = { setMode: stub };
|
||||
@@ -115,7 +111,7 @@ suite('set mode', () => {
|
||||
|
||||
test('does show error if mode change happens on a dirty file', async () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
const editorService = new MockEditorService(instantiationService, 'plaintext');
|
||||
const editorService = new MockEditorService('plaintext');
|
||||
const errorStub = sinon.stub();
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
instantiationService.stub(INotificationService, TestNotificationService);
|
||||
@@ -133,7 +129,7 @@ suite('set mode', () => {
|
||||
|
||||
class MockEditorService extends TestEditorService {
|
||||
|
||||
constructor(private readonly instantiationService: IInstantiationService, private readonly mode?: string) {
|
||||
constructor(private readonly mode?: string) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -145,8 +141,8 @@ class MockEditorService extends TestEditorService {
|
||||
return {
|
||||
getModel: () => {
|
||||
return <any>{
|
||||
getLanguageIdentifier: () => {
|
||||
return { language: this.mode };
|
||||
getLanguageId: () => {
|
||||
return this.mode;
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -157,16 +153,5 @@ class MockEditorService extends TestEditorService {
|
||||
override openEditor(_editor: any, _options?: any, _group?: any): Promise<any> {
|
||||
return Promise.resolve(_editor);
|
||||
}
|
||||
|
||||
override createEditorInput(_input: IUntitledTextResourceEditorInput): EditorInput {
|
||||
const accessor = this.instantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
return this.instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
}
|
||||
}
|
||||
|
||||
class ServiceAccessor {
|
||||
constructor(
|
||||
@IUntitledTextEditorService public readonly untitledTextEditorService: IUntitledTextEditorService
|
||||
) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user