mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
Change getCurrentConnection to return full ConnectionProfile (#6270)
This commit is contained in:
@@ -19,13 +19,7 @@ export class ExtHostConnectionManagement extends ExtHostConnectionManagementShap
|
||||
}
|
||||
|
||||
public $getCurrentConnection(): Thenable<azdata.connection.ConnectionProfile> {
|
||||
let connection: any = this._proxy.$getCurrentConnection();
|
||||
connection.then((conn) => {
|
||||
if (conn) {
|
||||
conn.providerId = conn.providerName;
|
||||
}
|
||||
});
|
||||
return connection;
|
||||
return this._proxy.$getCurrentConnectionProfile();
|
||||
}
|
||||
|
||||
public $getConnections(activeConnectionsOnly?: boolean): Thenable<azdata.connection.ConnectionProfile[]> {
|
||||
|
||||
@@ -56,6 +56,10 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
|
||||
return Promise.resolve(this.convertConnection(TaskUtilities.getCurrentGlobalConnection(this._objectExplorerService, this._connectionManagementService, this._workbenchEditorService, true)));
|
||||
}
|
||||
|
||||
public $getCurrentConnectionProfile(): Thenable<azdata.connection.ConnectionProfile> {
|
||||
return Promise.resolve(this.convertToConnectionProfile(TaskUtilities.getCurrentGlobalConnection(this._objectExplorerService, this._connectionManagementService, this._workbenchEditorService, true)));
|
||||
}
|
||||
|
||||
public $getCredentials(connectionId: string): Thenable<{ [name: string]: string }> {
|
||||
return Promise.resolve(this._connectionManagementService.getActiveConnectionCredentials(connectionId));
|
||||
}
|
||||
@@ -120,7 +124,7 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
|
||||
let connection: azdata.connection.Connection = {
|
||||
providerName: profile.providerName,
|
||||
connectionId: profile.id,
|
||||
options: profile.options
|
||||
options: deepClone(profile.options)
|
||||
};
|
||||
return connection;
|
||||
}
|
||||
|
||||
@@ -609,6 +609,7 @@ export interface MainThreadConnectionManagementShape extends IDisposable {
|
||||
$getConnections(activeConnectionsOnly?: boolean): Thenable<azdata.connection.ConnectionProfile[]>;
|
||||
$getActiveConnections(): Thenable<azdata.connection.Connection[]>;
|
||||
$getCurrentConnection(): Thenable<azdata.connection.Connection>;
|
||||
$getCurrentConnectionProfile(): Thenable<azdata.connection.ConnectionProfile>;
|
||||
$getCredentials(connectionId: string): Thenable<{ [name: string]: string }>;
|
||||
$getServerInfo(connectedId: string): Thenable<azdata.ServerInfo>;
|
||||
$openConnectionDialog(providers: string[], initialConnectionProfile?: azdata.IConnectionProfile, connectionCompletionOptions?: azdata.IConnectionCompletionOptions): Thenable<azdata.connection.Connection>;
|
||||
|
||||
Reference in New Issue
Block a user