Skip to content

Commit 29e0832

Browse files
committed
listen to other setters
1 parent f56819d commit 29e0832

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { CodeCellViewModel } from '../../viewModel/codeCellViewModel.js';
1515
import { Event } from '../../../../../../base/common/event.js';
1616
import { IChatAgentService } from '../../../../chat/common/chatAgents.js';
1717
import { ChatAgentLocation } from '../../../../chat/common/constants.js';
18+
import { autorun } from '../../../../../../base/common/observable.js';
1819

1920
export class CellDiagnostics extends Disposable implements INotebookEditorContribution {
2021

@@ -121,6 +122,11 @@ export class CellDiagnostics extends Disposable implements INotebookEditorContri
121122
disposables.push(toDisposable(() => this.markerService.changeOne(CellDiagnostics.ID, cell.uri, [])));
122123
cell.executionErrorDiagnostic.set(metadata.error, undefined);
123124
disposables.push(toDisposable(() => cell.executionErrorDiagnostic.set(undefined, undefined)));
125+
disposables.push(autorun((r) => {
126+
if (!cell.executionErrorDiagnostic.read(r)) {
127+
this.clear(cellHandle);
128+
}
129+
}));
124130
disposables.push(cell.model.onDidChangeOutputs(() => {
125131
if (cell.model.outputs.length === 0) {
126132
this.clear(cellHandle);

0 commit comments

Comments
 (0)