Unified connection in notebooks (#3898)

* yarn files

* #3897: Integrate unified connection with notebooks

* ConnectionProfile serialization in unified connection

* #3898 Handle connection validation from extension

* Removing unused namespaces

* Remove constant

* Show a detailed error message on changing context

* Indentation
This commit is contained in:
Raj
2019-02-05 11:54:29 -08:00
committed by GitHub
parent 8cf8cefc92
commit 0e54393d5a
6 changed files with 1651 additions and 3 deletions

View File

@@ -451,7 +451,11 @@ export class NotebookModel extends Disposable implements INotebookModel {
let newConnectionProfile = new ConnectionProfile(this.notebookOptions.capabilitiesService, newConnection);
this._activeConnection = newConnectionProfile;
this.refreshConnections(newConnectionProfile);
await this._activeClientSession.updateConnection(this._activeConnection);
this._activeClientSession.updateConnection(this._activeConnection.toIConnectionProfile()).catch((error) => {
if (error) {
this.notifyError(error.message);
}
});
} catch (err) {
let msg = notebookUtils.getErrorMessage(err);
this.notifyError(localize('changeContextFailed', 'Changing context failed: {0}', msg));
@@ -556,7 +560,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
if (this._activeClientSession) {
try {
await this._activeClientSession.ready;
} catch(err) {
} catch (err) {
this.notifyError(localize('shutdownClientSessionError', 'A client session error occurred when closing the notebook: {0}', err));
}
await this._activeClientSession.shutdown();

View File

@@ -158,7 +158,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
serverName: this.serverName,
databaseName: this.databaseName,
authenticationType: this.authenticationType,
getOptionsKey: undefined,
getOptionsKey: this.getOptionsKey,
matches: undefined,
groupId: this.groupId,
groupFullName: this.groupFullName,