mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 01:25:36 -05:00
Fix for standard in hovering in code cell (#6107)
This commit is contained in:
@@ -232,7 +232,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
|
||||
}));
|
||||
this._register(this.model.layoutChanged(() => this._layoutEmitter.fire(), this));
|
||||
this._register(this.cellModel.onExecutionStateChange(event => {
|
||||
if (event === CellExecutionState.Running) {
|
||||
if (event === CellExecutionState.Running && !this.cellModel.stdInVisible) {
|
||||
this.setFocusAndScroll();
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -81,6 +81,7 @@ export class CodeCellComponent extends CellView implements OnInit, OnChanges {
|
||||
if (msg) {
|
||||
this.stdIn = msg;
|
||||
this.inputDeferred = new Deferred();
|
||||
this.cellModel.stdInVisible = true;
|
||||
this._changeRef.detectChanges();
|
||||
return this.awaitStdIn();
|
||||
}
|
||||
@@ -97,11 +98,12 @@ export class CodeCellComponent extends CellView implements OnInit, OnChanges {
|
||||
// Clean up so no matter what, the stdIn request goes away
|
||||
this.stdIn = undefined;
|
||||
this.inputDeferred = undefined;
|
||||
this.cellModel.stdInVisible = false;
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
}
|
||||
|
||||
get isStdInVisible(): boolean {
|
||||
return !!(this.stdIn && this.inputDeferred);
|
||||
return this.cellModel.stdInVisible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ export class CellModel implements ICellModel {
|
||||
private _stdInHandler: nb.MessageHandler<nb.IStdinMessage>;
|
||||
private _onCellLoaded = new Emitter<string>();
|
||||
private _loaded: boolean;
|
||||
private _stdInVisible: boolean;
|
||||
|
||||
constructor(cellData: nb.ICellContents,
|
||||
private _options: ICellModelOptions,
|
||||
@@ -56,6 +57,7 @@ export class CellModel implements ICellModel {
|
||||
this._source = '';
|
||||
}
|
||||
this._isEditMode = this._cellType !== CellTypes.Markdown;
|
||||
this._stdInVisible = false;
|
||||
if (_options && _options.isTrusted) {
|
||||
this._isTrusted = true;
|
||||
} else {
|
||||
@@ -200,6 +202,14 @@ export class CellModel implements ICellModel {
|
||||
}
|
||||
}
|
||||
|
||||
public get stdInVisible(): boolean {
|
||||
return this._stdInVisible;
|
||||
}
|
||||
|
||||
public set stdInVisible(val: boolean) {
|
||||
this._stdInVisible = val;
|
||||
}
|
||||
|
||||
private notifyExecutionComplete(): void {
|
||||
if (this._notebookService) {
|
||||
this._notebookService.serializeNotebookStateChange(this.notebookModel.notebookUri, NotebookChangeType.CellExecuted);
|
||||
|
||||
@@ -467,6 +467,7 @@ export interface ICellModel {
|
||||
equals(cellModel: ICellModel): boolean;
|
||||
toJSON(): nb.ICellContents;
|
||||
loaded: boolean;
|
||||
stdInVisible: boolean;
|
||||
readonly onLoaded: Event<string>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user