mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
* Modify where we add active connections so that we can use the saveTheConnection option to decide whether to add a connection to the MRU. This was necessary because the old location was called from onConnectionComplete which is sent by the SqlToolsService - and that doesn't get any UI related information like the options. The new location is still only called after the connection completes and will be added only if the connection succeeds. Added new test and updated existing tests to handle new logic (plus a bit of async-refactoring). * Fix couple spacing issues * Add logic back in to short-circuit if we already have the connection in the active connections list. * Fix spaces -> tabs
This commit is contained in:
@@ -181,6 +181,13 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this profile is connected to the default database (it doesn't specify a database to connect to)
|
||||
*/
|
||||
public static isConnectionToDefaultDb(profile: azdata.IConnectionProfile): boolean {
|
||||
return !profile.databaseName || profile.databaseName.trim() === '';
|
||||
}
|
||||
|
||||
public static fromIConnectionProfile(capabilitiesService: ICapabilitiesService, profile: azdata.IConnectionProfile) {
|
||||
if (profile) {
|
||||
if (profile instanceof ConnectionProfile) {
|
||||
|
||||
Reference in New Issue
Block a user