Skip to content

listen to other setters for clearing diagnostic #246791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { CodeCellViewModel } from '../../viewModel/codeCellViewModel.js';
import { Event } from '../../../../../../base/common/event.js';
import { IChatAgentService } from '../../../../chat/common/chatAgents.js';
import { ChatAgentLocation } from '../../../../chat/common/constants.js';
import { autorun } from '../../../../../../base/common/observable.js';

export class CellDiagnostics extends Disposable implements INotebookEditorContribution {

Expand Down Expand Up @@ -121,6 +122,11 @@ export class CellDiagnostics extends Disposable implements INotebookEditorContri
disposables.push(toDisposable(() => this.markerService.changeOne(CellDiagnostics.ID, cell.uri, [])));
cell.executionErrorDiagnostic.set(metadata.error, undefined);
disposables.push(toDisposable(() => cell.executionErrorDiagnostic.set(undefined, undefined)));
disposables.push(autorun((r) => {
if (!cell.executionErrorDiagnostic.read(r)) {
this.clear(cellHandle);
}
}));
disposables.push(cell.model.onDidChangeOutputs(() => {
if (cell.model.outputs.length === 0) {
this.clear(cellHandle);
Expand Down
Loading