mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51: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> {
|
public $getCurrentConnection(): Thenable<azdata.connection.ConnectionProfile> {
|
||||||
let connection: any = this._proxy.$getCurrentConnection();
|
return this._proxy.$getCurrentConnectionProfile();
|
||||||
connection.then((conn) => {
|
|
||||||
if (conn) {
|
|
||||||
conn.providerId = conn.providerName;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return connection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public $getConnections(activeConnectionsOnly?: boolean): Thenable<azdata.connection.ConnectionProfile[]> {
|
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)));
|
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 }> {
|
public $getCredentials(connectionId: string): Thenable<{ [name: string]: string }> {
|
||||||
return Promise.resolve(this._connectionManagementService.getActiveConnectionCredentials(connectionId));
|
return Promise.resolve(this._connectionManagementService.getActiveConnectionCredentials(connectionId));
|
||||||
}
|
}
|
||||||
@@ -120,7 +124,7 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
|
|||||||
let connection: azdata.connection.Connection = {
|
let connection: azdata.connection.Connection = {
|
||||||
providerName: profile.providerName,
|
providerName: profile.providerName,
|
||||||
connectionId: profile.id,
|
connectionId: profile.id,
|
||||||
options: profile.options
|
options: deepClone(profile.options)
|
||||||
};
|
};
|
||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -609,6 +609,7 @@ export interface MainThreadConnectionManagementShape extends IDisposable {
|
|||||||
$getConnections(activeConnectionsOnly?: boolean): Thenable<azdata.connection.ConnectionProfile[]>;
|
$getConnections(activeConnectionsOnly?: boolean): Thenable<azdata.connection.ConnectionProfile[]>;
|
||||||
$getActiveConnections(): Thenable<azdata.connection.Connection[]>;
|
$getActiveConnections(): Thenable<azdata.connection.Connection[]>;
|
||||||
$getCurrentConnection(): Thenable<azdata.connection.Connection>;
|
$getCurrentConnection(): Thenable<azdata.connection.Connection>;
|
||||||
|
$getCurrentConnectionProfile(): Thenable<azdata.connection.ConnectionProfile>;
|
||||||
$getCredentials(connectionId: string): Thenable<{ [name: string]: string }>;
|
$getCredentials(connectionId: string): Thenable<{ [name: string]: string }>;
|
||||||
$getServerInfo(connectedId: string): Thenable<azdata.ServerInfo>;
|
$getServerInfo(connectedId: string): Thenable<azdata.ServerInfo>;
|
||||||
$openConnectionDialog(providers: string[], initialConnectionProfile?: azdata.IConnectionProfile, connectionCompletionOptions?: azdata.IConnectionCompletionOptions): Thenable<azdata.connection.Connection>;
|
$openConnectionDialog(providers: string[], initialConnectionProfile?: azdata.IConnectionProfile, connectionCompletionOptions?: azdata.IConnectionCompletionOptions): Thenable<azdata.connection.Connection>;
|
||||||
|
|||||||
Reference in New Issue
Block a user