Skip to content

Commit

Permalink
show a spinner if the Output box is out of date
Browse files Browse the repository at this point in the history
  • Loading branch information
KasraF committed Mar 24, 2023
1 parent 6b46de2 commit 8129e98
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/vs/editor/contrib/rtv/browser/RTVDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ class RTVOutputDisplayBox {
throw new Error('Cannot find Monaco Editor');
}

if (this._outOfDate) {
this.setSpinner();
}

this._box.style.display = 'inline-block';
this._box.style.opacity = '1';
editor_div.appendChild(this._box);
Expand Down Expand Up @@ -338,6 +342,15 @@ class RTVOutputDisplayBox {
this._outOfDate = true;
}

public setSpinner() {
this.setContent(
`<div class="d-flex justify-content-center align-items-center mt-5">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>`);
}

public update(outputMsg: string, errorMsg: string, parsedResults: any) {
this._outOfDate = false;

Expand Down Expand Up @@ -2987,6 +3000,7 @@ export class RTVController implements IRTVController {

this._eventEmitter.fire(new BoxUpdateEvent(true, false, false));

this.getOutputBox().outOfDate();
this.hideOutputBox();

const [outputMsg, errorMsg, parsedResult] = await this.runProgram();
Expand Down

0 comments on commit 8129e98

Please sign in to comment.