Adds build connection info feature (#2192)

* connection string

* formatting

* change serailize reponse type to match connect params

* add connection string serialization

* readd the connection string to the connection widget

* format

* remove unnecessary change

* update serializer to require provider

* update name of function

* fix function name

* bump dataprotocol and sqltools

* revert unnecessary change

* remove more unnecessary chagnes

* bump sqltoolsserivce

* adde configuration for auto parsing the clipboard
This commit is contained in:
Anthony Dresser
2018-08-20 11:50:16 -07:00
committed by Karl Burtram
parent 21c4429c6e
commit 033c8cb8b1
14 changed files with 98 additions and 23 deletions

View File

@@ -92,5 +92,10 @@ configurationRegistry.registerConfiguration({
'description': localize('sql.defaultEngineDescription', 'Default SQL Engine to use. This drives default language provider in .sql files and the default to use when creating a new connection. Valid option is currently MSSQL'),
'default': 'MSSQL'
},
'connection.parseClipboardForConnectionString': {
'type': 'boolean',
'default': true,
'description': localize('connection.parseClipboardForConnectionStringDescription', 'Attempt to parse the contents of the clipboard when the connection dialog is opened or a paste is performed.')
}
}
});
});

View File

@@ -266,6 +266,11 @@ export interface IConnectionManagementService {
* Get the connection string for the provided connection profile
*/
getConnectionString(ownerUri: string, includePassword: boolean): Thenable<string>;
/**
* Serialize connection string with optional provider
*/
buildConnectionInfo(connectionString: string, provider?: string): Thenable<sqlops.ConnectionInfo>;
}
export const IConnectionDialogService = createDecorator<IConnectionDialogService>('connectionDialogService');

View File

@@ -1366,4 +1366,14 @@ export class ConnectionManagementService extends Disposable implements IConnecti
});
});
}
/**
* Serialize connection with options provider
* TODO this could be a map reduce operation
*/
public buildConnectionInfo(connectionString: string, provider: string): Thenable<sqlops.ConnectionInfo> {
return this._providers.get(provider).onReady.then(e => {
return e.buildConnectionInfo(connectionString);
});
}
}