mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 17:23:29 -05:00
Added SQL notebook IntelliSense (#4064)
* Added SQL notebook intelliSense * Resolved PR comments. * catch disconnect error
This commit is contained in:
@@ -132,6 +132,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.disconnect();
|
||||
this.dispose();
|
||||
if (this.notebookService) {
|
||||
this.notebookService.removeNotebookEditor(this);
|
||||
@@ -165,6 +166,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
}
|
||||
if (cell !== this.model.activeCell) {
|
||||
if (this.model.activeCell) {
|
||||
this.disconnect();
|
||||
this.model.activeCell.active = false;
|
||||
}
|
||||
this._model.activeCell = cell;
|
||||
@@ -173,6 +175,14 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
}
|
||||
}
|
||||
|
||||
private disconnect() {
|
||||
if (this._model.defaultKernel.display_name === notebookConstants.SQL) {
|
||||
if (this._model.activeCell && this._model.activeCell.cellType === CellTypes.Code && this._model.activeCell.cellUri) {
|
||||
this.connectionManagementService.disconnect(this._model.activeCell.cellUri.toString()).catch(e => console.log(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unselectActiveCell() {
|
||||
if (this.model && this.model.activeCell) {
|
||||
this.model.activeCell.active = false;
|
||||
|
||||
Reference in New Issue
Block a user