mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-04 18:47:39 -05:00
Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
This commit is contained in:
@@ -10,7 +10,7 @@ import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { AddAccountAction, RemoveAccountAction } from 'sql/parts/accountManagement/common/accountActions';
|
||||
import { AccountManagementTestService } from 'sqltest/stubs/accountManagementStubs';
|
||||
import { MessageServiceStub } from 'sqltest/stubs/messageServiceStub';
|
||||
// import { MessageServiceStub } from 'sqltest/stubs/messageServiceStub';
|
||||
import { ErrorMessageServiceStub } from 'sqltest/stubs/errorMessageServiceStub';
|
||||
|
||||
let testAccount = <sqlops.Account>{
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
'use strict';
|
||||
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { IMessageService } from 'vs/platform/message/common/message';
|
||||
import { TestMessageService, TestEditorGroupService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { EditorInput } from 'vs/workbench/common/editor';
|
||||
import { IEditorDescriptor } from 'vs/workbench/browser/editor';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
@@ -32,12 +30,14 @@ import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { INotification, INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { TestNotificationService } from 'vs/workbench/test/workbenchTestServices';
|
||||
|
||||
suite('SQL QueryEditor Tests', () => {
|
||||
let queryModelService: QueryModelService;
|
||||
let instantiationService: TypeMoq.Mock<InstantiationService>;
|
||||
let themeService: TestThemeService = new TestThemeService();
|
||||
let messageService: TypeMoq.Mock<IMessageService>;
|
||||
let notificationService: TypeMoq.Mock<INotificationService>;
|
||||
let editorDescriptorService: TypeMoq.Mock<EditorDescriptorService>;
|
||||
let connectionManagementService: TypeMoq.Mock<ConnectionManagementService>;
|
||||
let memento: TypeMoq.Mock<Memento>;
|
||||
@@ -124,7 +124,7 @@ suite('SQL QueryEditor Tests', () => {
|
||||
queryInput2 = new QueryInput('second', 'second', fileInput2, queryResultsInput2, undefined, undefined, undefined, undefined);
|
||||
|
||||
// Mock IMessageService
|
||||
messageService = TypeMoq.Mock.ofType(TestMessageService, TypeMoq.MockBehavior.Loose);
|
||||
notificationService = TypeMoq.Mock.ofType(TestNotificationService, TypeMoq.MockBehavior.Loose);
|
||||
|
||||
// Mock ConnectionManagementService
|
||||
memento = TypeMoq.Mock.ofType(Memento, TypeMoq.MockBehavior.Loose, '');
|
||||
@@ -134,7 +134,7 @@ suite('SQL QueryEditor Tests', () => {
|
||||
connectionManagementService.setup(x => x.isConnected(TypeMoq.It.isAny())).returns(() => false);
|
||||
|
||||
// Create a QueryModelService
|
||||
queryModelService = new QueryModelService(instantiationService.object, messageService.object);
|
||||
queryModelService = new QueryModelService(instantiationService.object, notificationService.object);
|
||||
});
|
||||
|
||||
test('createEditor creates only the taskbar', (done) => {
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IConfirmation, IMessageService, IMessageWithAction, IConfirmationResult } from 'vs/platform/message/common/message';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
||||
export class MessageServiceStub implements IMessageService{
|
||||
export class MessageServiceStub implements IMessageService {
|
||||
_serviceBrand: any;
|
||||
|
||||
show(sev: Severity, message: string): () => void;
|
||||
@@ -29,17 +30,13 @@ export class MessageServiceStub implements IMessageService{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask the user for confirmation.
|
||||
*/
|
||||
confirmSync(confirmation: IConfirmation): boolean {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask the user for confirmation with a checkbox.
|
||||
*/
|
||||
|
||||
confirmWithCheckbox(confirmation: IConfirmation): TPromise<IConfirmationResult> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -10,6 +10,7 @@ import { IEditorService, IEditor, IEditorInput, IEditorOptions, ITextEditorOptio
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { EditorInput, EditorOptions, IFileEditorInput, TextEditorOptions, Extensions, SideBySideEditorInput } from 'vs/workbench/common/editor';
|
||||
import { ICloseEditorsFilter } from 'vs/workbench/browser/parts/editor/editorPart';
|
||||
|
||||
export class WorkbenchEditorTestService implements IWorkbenchEditorService {
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
@@ -87,7 +88,7 @@ export class WorkbenchEditorTestService implements IWorkbenchEditorService {
|
||||
* will not be closed. The direction can be used in that case to control if all other editors should get closed,
|
||||
* or towards a specific direction.
|
||||
*/
|
||||
closeEditors(position: Position, filter?: { except?: IEditorInput, direction?: Direction, unmodifiedOnly?: boolean }): TPromise<void> {
|
||||
closeEditors(p1?: any, p2?: any, p3?: any): TPromise<void> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,34 +10,34 @@ import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { AccountProviderStub, AccountManagementTestService } from 'sqltest/stubs/accountManagementStubs';
|
||||
import { ExtHostAccountManagement } from 'sql/workbench/api/node/extHostAccountManagement';
|
||||
import { TestThreadService } from 'vs/workbench/test/electron-browser/api/testThreadService';
|
||||
import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IRPCProtocol } from 'vs/workbench/services/extensions/node/proxyIdentifier';
|
||||
import { SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { MainThreadAccountManagement } from 'sql/workbench/api/node/mainThreadAccountManagement';
|
||||
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
const IThreadService = createDecorator<IThreadService>('threadService');
|
||||
const IRPCProtocol = createDecorator<IRPCProtocol>('rpcProtocol');
|
||||
|
||||
// SUITE STATE /////////////////////////////////////////////////////////////
|
||||
let instantiationService: TestInstantiationService;
|
||||
let mockAccountMetadata: sqlops.AccountProviderMetadata;
|
||||
let mockAccount: sqlops.Account;
|
||||
let threadService: TestThreadService;
|
||||
let threadService: TestRPCProtocol;
|
||||
|
||||
// TESTS ///////////////////////////////////////////////////////////////////
|
||||
suite('ExtHostAccountManagement', () => {
|
||||
suiteSetup(() => {
|
||||
threadService = new TestThreadService();
|
||||
threadService = new TestRPCProtocol();
|
||||
const accountMgmtStub = new AccountManagementTestService();
|
||||
|
||||
instantiationService = new TestInstantiationService();
|
||||
instantiationService.stub(IThreadService, threadService);
|
||||
instantiationService.stub(IRPCProtocol, threadService);
|
||||
instantiationService.stub(IAccountManagementService, accountMgmtStub);
|
||||
|
||||
const accountMgmtService = instantiationService.createInstance(MainThreadAccountManagement);
|
||||
threadService.setTestInstance(SqlMainContext.MainThreadAccountManagement, accountMgmtService);
|
||||
threadService.set(SqlMainContext.MainThreadAccountManagement, accountMgmtService);
|
||||
|
||||
mockAccountMetadata = {
|
||||
args: {},
|
||||
|
||||
@@ -6,36 +6,36 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { TestThreadService } from 'vs/workbench/test/electron-browser/api/testThreadService';
|
||||
import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { ExtHostCredentialManagement } from 'sql/workbench/api/node/extHostCredentialManagement';
|
||||
import { SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IRPCProtocol } from 'vs/workbench/services/extensions/node/proxyIdentifier';
|
||||
import { MainThreadCredentialManagement } from 'sql/workbench/api/node/mainThreadCredentialManagement';
|
||||
import { CredentialsTestProvider, CredentialsTestService } from 'sqltest/stubs/credentialsTestStubs';
|
||||
import { ICredentialsService } from 'sql/services/credentials/credentialsService';
|
||||
import { Credential, CredentialProvider } from 'sqlops';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
const IThreadService = createDecorator<IThreadService>('threadService');
|
||||
const IRPCProtocol = createDecorator<IRPCProtocol>('rpcProtocol');
|
||||
|
||||
// SUITE STATE /////////////////////////////////////////////////////////////
|
||||
let credentialServiceStub: CredentialsTestService;
|
||||
let instantiationService: TestInstantiationService;
|
||||
let threadService: TestThreadService;
|
||||
let threadService: TestRPCProtocol;
|
||||
|
||||
// TESTS ///////////////////////////////////////////////////////////////////
|
||||
suite('ExtHostCredentialManagement', () => {
|
||||
suiteSetup(() => {
|
||||
threadService = new TestThreadService();
|
||||
threadService = new TestRPCProtocol();
|
||||
credentialServiceStub = new CredentialsTestService();
|
||||
|
||||
instantiationService = new TestInstantiationService();
|
||||
instantiationService.stub(IThreadService, threadService);
|
||||
instantiationService.stub(IRPCProtocol, threadService);
|
||||
instantiationService.stub(ICredentialsService, credentialServiceStub);
|
||||
|
||||
const credentialService = instantiationService.createInstance(MainThreadCredentialManagement);
|
||||
threadService.setTestInstance(SqlMainContext.MainThreadCredentialManagement, credentialService);
|
||||
threadService.set(SqlMainContext.MainThreadCredentialManagement, credentialService);
|
||||
});
|
||||
|
||||
test('Construct ExtHostCredentialManagement', () => {
|
||||
|
||||
@@ -10,12 +10,12 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
|
||||
import { setUnexpectedErrorHandler, errorHandler } from 'vs/base/common/errors';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import * as EditorCommon from 'vs/editor/common/editorCommon';
|
||||
import { Model as EditorModel } from 'vs/editor/common/model/model';
|
||||
import { TestThreadService } from 'vs/workbench/test/electron-browser/api/testThreadService';
|
||||
import { TextModel as EditorModel } from 'vs/editor/common/model/textModel';
|
||||
import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IMarkerService } from 'vs/platform/markers/common/markers';
|
||||
import { MarkerService } from 'vs/platform/markers/common/markerService';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IRPCProtocol } from 'vs/workbench/services/extensions/node/proxyIdentifier';
|
||||
import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands';
|
||||
import { MainThreadCommands } from 'vs/workbench/api/electron-browser/mainThreadCommands';
|
||||
import { IHeapService } from 'vs/workbench/api/electron-browser/mainThreadHeapService';
|
||||
@@ -31,9 +31,9 @@ import * as sqlops from 'sqlops';
|
||||
import { ExtHostDataProtocol } from 'sql/workbench/api/node/extHostDataProtocol';
|
||||
import { SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
|
||||
const IThreadService = createDecorator<IThreadService>('threadService');
|
||||
const IRPCProtocol = createDecorator<IRPCProtocol>('rpcProtocol');
|
||||
|
||||
const model: EditorCommon.IModel = EditorModel.createFromString(
|
||||
const model = EditorModel.createFromString(
|
||||
[
|
||||
'This is the first line',
|
||||
'This is the second line',
|
||||
@@ -45,7 +45,7 @@ const model: EditorCommon.IModel = EditorModel.createFromString(
|
||||
|
||||
let extHost: ExtHostDataProtocol;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
let threadService: TestThreadService;
|
||||
let threadService: TestRPCProtocol;
|
||||
let originalErrorHandler: (e: any) => any;
|
||||
|
||||
suite('ExtHostDataProtocol', function () {
|
||||
|
||||
Reference in New Issue
Block a user