diff --git a/src/sql/parts/connection/common/connectionProfile.ts b/src/sql/parts/connection/common/connectionProfile.ts index 9f490135ad..b000e3b40e 100644 --- a/src/sql/parts/connection/common/connectionProfile.ts +++ b/src/sql/parts/connection/common/connectionProfile.ts @@ -33,7 +33,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa public constructor( capabilitiesService: ICapabilitiesService, - model: string | interfaces.IConnectionProfile + model: string | sqlops.IConnectionProfile ) { super(capabilitiesService, model); if (model && !isString(model)) { @@ -171,7 +171,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa }; } - public static fromIConnectionProfile(capabilitiesService: ICapabilitiesService, profile: interfaces.IConnectionProfile) { + public static fromIConnectionProfile(capabilitiesService: ICapabilitiesService, profile: sqlops.IConnectionProfile) { if (profile) { if (profile instanceof ConnectionProfile) { return profile; diff --git a/src/sql/parts/connection/common/providerConnectionInfo.ts b/src/sql/parts/connection/common/providerConnectionInfo.ts index 0ebed17b1b..45165a10d9 100644 --- a/src/sql/parts/connection/common/providerConnectionInfo.ts +++ b/src/sql/parts/connection/common/providerConnectionInfo.ts @@ -26,7 +26,7 @@ export class ProviderConnectionInfo extends Disposable implements sqlops.Connect public constructor( protected capabilitiesService: ICapabilitiesService, - model: string | interfaces.IConnectionProfile + model: string | sqlops.IConnectionProfile ) { super(); // we can't really do a whole lot if we don't have a provider @@ -195,8 +195,8 @@ export class ProviderConnectionInfo extends Disposable implements sqlops.Connect if (this._serverCapabilities) { idNames = this._serverCapabilities.connectionOptions.map(o => { if ((o.specialValueType || o.isIdentity) - && o.specialValueType !== ConnectionOptionSpecialType.password - && o.specialValueType !== ConnectionOptionSpecialType.connectionName) { + && o.specialValueType !== ConnectionOptionSpecialType.password + && o.specialValueType !== ConnectionOptionSpecialType.connectionName) { return o.name; } else { return undefined; diff --git a/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts b/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts index 45f3257ded..9c68a963c5 100644 --- a/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts +++ b/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts @@ -6,9 +6,9 @@ import { localize } from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile'; import { IConnectionManagementService, IErrorMessageService } from 'sql/parts/connection/common/connectionManagement'; +import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService'; import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService'; import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView'; import { ConnectionViewlet } from 'sql/parts/objectExplorer/viewlet/connectionViewlet'; @@ -20,7 +20,7 @@ import * as Constants from 'sql/parts/connection/common/constants'; import { IObjectExplorerService } from 'sql/parts/objectExplorer/common/objectExplorerService'; import { TreeNode } from 'sql/parts/objectExplorer/common/treeNode'; import Severity from 'vs/base/common/severity'; -import { ObjectExplorerActionsContext, ObjectExplorerActionUtilities } from 'sql/parts/objectExplorer/viewlet/objectExplorerActions'; +import { ObjectExplorerActionsContext } from 'sql/parts/objectExplorer/viewlet/objectExplorerActions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; export class RefreshAction extends Action { @@ -323,7 +323,8 @@ export class NewQueryAction extends Action { @IQueryEditorService private queryEditorService: IQueryEditorService, @IConnectionManagementService private connectionManagementService: IConnectionManagementService, @IObjectExplorerService protected _objectExplorerService: IObjectExplorerService, - @IEditorService protected _workbenchEditorService: IEditorService + @IEditorService protected _workbenchEditorService: IEditorService, + @ICapabilitiesService private _capabilitiesService: ICapabilitiesService ) { super(id, label); this.class = 'extension-action update'; @@ -331,7 +332,7 @@ export class NewQueryAction extends Action { public run(actionContext: ObjectExplorerActionsContext): TPromise { if (actionContext instanceof ObjectExplorerActionsContext) { - this._connectionProfile = actionContext.connectionProfile; + this._connectionProfile = new ConnectionProfile(this._capabilitiesService, actionContext.connectionProfile); } TaskUtilities.newQuery(this._connectionProfile, this.connectionManagementService, this.queryEditorService, this._objectExplorerService, this._workbenchEditorService); diff --git a/src/sql/parts/objectExplorer/viewlet/objectExplorerActions.ts b/src/sql/parts/objectExplorer/viewlet/objectExplorerActions.ts index 31c593177e..23a2983d5f 100644 --- a/src/sql/parts/objectExplorer/viewlet/objectExplorerActions.ts +++ b/src/sql/parts/objectExplorer/viewlet/objectExplorerActions.ts @@ -32,7 +32,7 @@ import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile export class ObjectExplorerActionsContext implements sqlops.ObjectExplorerContext { - public connectionProfile: IConnectionProfile; + public connectionProfile: sqlops.IConnectionProfile; public nodeInfo: sqlops.NodeInfo; public isConnectionNode: boolean = false; } @@ -52,8 +52,8 @@ export class OEAction extends ExecuteCommandAction { id: string, label: string, @IInstantiationService private _instantiationService: IInstantiationService, @ICommandService commandService: ICommandService, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, - @IObjectExplorerService private _objectExplorerService: IObjectExplorerService + @IObjectExplorerService private _objectExplorerService: IObjectExplorerService, + @ICapabilitiesService private _capabilitiesService: ICapabilitiesService ) { super(id, label, commandService); } @@ -65,7 +65,7 @@ export class OEAction extends ExecuteCommandAction { let profile: IConnectionProfile; if (actionContext instanceof ObjectExplorerActionsContext) { if (actionContext.isConnectionNode) { - profile = actionContext.connectionProfile; + profile = new ConnectionProfile(this._capabilitiesService, actionContext.connectionProfile); } else { // Get the "correct" version from the tree let treeNode = await getTreeNode(actionContext, this._objectExplorerService); diff --git a/src/sqltest/parts/connection/connectionTreeActions.test.ts b/src/sqltest/parts/connection/connectionTreeActions.test.ts index eabc33c858..e4e47bc96a 100644 --- a/src/sqltest/parts/connection/connectionTreeActions.test.ts +++ b/src/sqltest/parts/connection/connectionTreeActions.test.ts @@ -94,8 +94,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -132,8 +130,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -173,8 +169,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -286,8 +280,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -333,8 +325,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -370,8 +360,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -459,8 +447,6 @@ suite('SQL Connection Tree Action tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, diff --git a/src/sqltest/parts/connection/objectExplorerService.test.ts b/src/sqltest/parts/connection/objectExplorerService.test.ts index ef1b4345ed..db324406ec 100644 --- a/src/sqltest/parts/connection/objectExplorerService.test.ts +++ b/src/sqltest/parts/connection/objectExplorerService.test.ts @@ -231,8 +231,6 @@ suite('SQL Object Explorer Service tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true, @@ -250,8 +248,6 @@ suite('SQL Object Explorer Service tests', () => { password: 'test', userName: 'testUsername', groupId: undefined, - getOptionsKey: undefined, - matches: undefined, providerName: 'MSSQL', options: {}, saveProfile: true,