mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51: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.model.layoutChanged(() => this._layoutEmitter.fire(), this));
|
||||||
this._register(this.cellModel.onExecutionStateChange(event => {
|
this._register(this.cellModel.onExecutionStateChange(event => {
|
||||||
if (event === CellExecutionState.Running) {
|
if (event === CellExecutionState.Running && !this.cellModel.stdInVisible) {
|
||||||
this.setFocusAndScroll();
|
this.setFocusAndScroll();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export class CodeCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
if (msg) {
|
if (msg) {
|
||||||
this.stdIn = msg;
|
this.stdIn = msg;
|
||||||
this.inputDeferred = new Deferred();
|
this.inputDeferred = new Deferred();
|
||||||
|
this.cellModel.stdInVisible = true;
|
||||||
this._changeRef.detectChanges();
|
this._changeRef.detectChanges();
|
||||||
return this.awaitStdIn();
|
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
|
// Clean up so no matter what, the stdIn request goes away
|
||||||
this.stdIn = undefined;
|
this.stdIn = undefined;
|
||||||
this.inputDeferred = undefined;
|
this.inputDeferred = undefined;
|
||||||
|
this.cellModel.stdInVisible = false;
|
||||||
this._changeRef.detectChanges();
|
this._changeRef.detectChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get isStdInVisible(): boolean {
|
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 _stdInHandler: nb.MessageHandler<nb.IStdinMessage>;
|
||||||
private _onCellLoaded = new Emitter<string>();
|
private _onCellLoaded = new Emitter<string>();
|
||||||
private _loaded: boolean;
|
private _loaded: boolean;
|
||||||
|
private _stdInVisible: boolean;
|
||||||
|
|
||||||
constructor(cellData: nb.ICellContents,
|
constructor(cellData: nb.ICellContents,
|
||||||
private _options: ICellModelOptions,
|
private _options: ICellModelOptions,
|
||||||
@@ -56,6 +57,7 @@ export class CellModel implements ICellModel {
|
|||||||
this._source = '';
|
this._source = '';
|
||||||
}
|
}
|
||||||
this._isEditMode = this._cellType !== CellTypes.Markdown;
|
this._isEditMode = this._cellType !== CellTypes.Markdown;
|
||||||
|
this._stdInVisible = false;
|
||||||
if (_options && _options.isTrusted) {
|
if (_options && _options.isTrusted) {
|
||||||
this._isTrusted = true;
|
this._isTrusted = true;
|
||||||
} else {
|
} 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 {
|
private notifyExecutionComplete(): void {
|
||||||
if (this._notebookService) {
|
if (this._notebookService) {
|
||||||
this._notebookService.serializeNotebookStateChange(this.notebookModel.notebookUri, NotebookChangeType.CellExecuted);
|
this._notebookService.serializeNotebookStateChange(this.notebookModel.notebookUri, NotebookChangeType.CellExecuted);
|
||||||
|
|||||||
@@ -467,6 +467,7 @@ export interface ICellModel {
|
|||||||
equals(cellModel: ICellModel): boolean;
|
equals(cellModel: ICellModel): boolean;
|
||||||
toJSON(): nb.ICellContents;
|
toJSON(): nb.ICellContents;
|
||||||
loaded: boolean;
|
loaded: boolean;
|
||||||
|
stdInVisible: boolean;
|
||||||
readonly onLoaded: Event<string>;
|
readonly onLoaded: Event<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user