Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -19,12 +19,13 @@ import { TestQueryEditorService } from 'sql/workbench/services/queryEditor/test/
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, EditorInput, IVisibleEditorPane } from 'vs/workbench/common/editor';
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/common/editors/fileEditorInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/fileEditorInput';
import { URI } from 'vs/base/common/uri';
import { FileQueryEditorInput } from 'sql/workbench/contrib/query/common/fileQueryEditorInput';
import { FileQueryEditorInput } from 'sql/workbench/contrib/query/browser/fileQueryEditorInput';
import { QueryResultsInput } from 'sql/workbench/common/editor/query/queryResultsInput';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EditorType } from 'vs/editor/common/editorCommon';
@@ -39,7 +40,7 @@ suite('set mode', () => {
let disposables: IDisposable[] = [];
function createFileInput(resource: URI, preferredResource?: URI, preferredMode?: string, preferredName?: string, preferredDescription?: string): FileEditorInput {
return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, undefined, preferredMode);
return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, undefined, preferredMode, undefined);
}
setup(() => {
@@ -62,7 +63,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');
instantiationService.stub(IEditorService, editorService);
const replaceEditorStub = sinon.stub(editorService, 'replaceEditors', () => Promise.resolve());
const replaceEditorStub = sinon.stub(editorService, 'replaceEditors').callsFake(() => Promise.resolve());
const stub = sinon.stub();
const modeSupport = { setMode: stub };
const activeEditor = createFileInput(URI.file('/test/file.txt'), undefined, 'plaintext', undefined);
@@ -122,7 +123,7 @@ suite('set mode', () => {
const stub = sinon.stub();
const modeSupport = { setMode: stub };
const activeEditor = createFileInput(URI.file('/test/file.txt'), undefined, 'plaintext', undefined);
sinon.stub(activeEditor, 'isDirty', () => true);
sinon.stub(activeEditor, 'isDirty').callsFake(() => true);
await instantiationService.invokeFunction(setMode, modeSupport, activeEditor, 'sql');
assert(stub.notCalled);
assert(errorStub.calledOnce);

View File

@@ -11,7 +11,6 @@ import { TestConnectionManagementService } from 'sql/platform/connection/test/co
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices';
import { assign } from 'vs/base/common/objects';
suite('TaskUtilities', function () {
test('getCurrentGlobalConnection returns the selected OE server if a server or one of its children is selected', () => {
@@ -61,7 +60,7 @@ suite('TaskUtilities', function () {
let mockConnectionManagementService = TypeMoq.Mock.ofType(TestConnectionManagementService);
let mockWorkbenchEditorService = TypeMoq.Mock.ofType(TestEditorService);
let oeProfile = new ConnectionProfile(undefined, connectionProfile);
let connectionProfile2 = assign({}, connectionProfile);
let connectionProfile2 = Object.assign({}, connectionProfile);
connectionProfile2.serverName = 'test_server_2';
connectionProfile2.id = 'test_id_2';
let tabProfile = new ConnectionProfile(undefined, connectionProfile2);

View File

@@ -11,7 +11,6 @@ import { MainThreadModelViewShape } from 'sql/workbench/api/common/sqlExtHost.pr
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { IComponentShape, IItemConfig, ComponentEventType, IComponentEventArgs, ModelComponentTypes, DeclarativeDataType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { TitledFormItemLayout } from 'sql/workbench/browser/modelComponents/formContainer.component';
import { assign } from 'vs/base/common/objects';
interface InternalItemConfig {
toIItemConfig(): IItemConfig;
@@ -178,7 +177,7 @@ suite('ExtHostModelView Validation Tests', () => {
topLevelInputFormComponent,
{
components: [
assign(groupInputFormComponent, { layout: groupInputLayout }),
Object.assign(groupInputFormComponent, { layout: groupInputLayout }),
groupDropdownFormComponent
],
title: groupTitle

View File

@@ -30,7 +30,7 @@ suite('MainThreadNotebook Tests', () => {
let providerId = 'TestProvider';
setup(() => {
mockProxy = TypeMoq.Mock.ofType(ExtHostNotebookStub);
mockProxy = TypeMoq.Mock.ofType<ExtHostNotebookShape>(ExtHostNotebookStub);
let extContext = <IExtHostContext>{
getProxy: proxyType => mockProxy.object
};