Skip to content

Conversation

@DonJayamanne
Copy link

@DonJayamanne DonJayamanne commented Jun 21, 2021

Fixes some long standing issues in microsoft/vscode-jupyter#5161


private onDidChangeCellsEmitter = new EventEmitter<TextDocumentChangeEvent>();

private mapOfConcatDocumentsWithCellUris = new Map<string, string[]>();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing the Uris as strings (don't want to be storing the objects)

const currentCellUris = new Set(cellUris);
oldCellUris
.filter((cellUri) => !currentCellUris.has(cellUri))
.forEach((cellUri) => result.set(Uri.parse(cellUri), []));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, if we delete a cell, the diagnostics of deleted cells remains & doesn't go away.

} else if (this.mapOfConcatDocumentsWithCellUris.has(uri.toString())) {
(this.mapOfConcatDocumentsWithCellUris.get(uri.toString()) || [])
.map((cellUri) => Uri.parse(cellUri))
.forEach((cellUri) => result.set(cellUri, []));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, if a notebook is closed, the diagnostics don't go away.
This is because when a notebook is closed, the wrapper is disposed and we don't have the wrapper document, hence we cannot get the cells to clear the diagnostics.

@DonJayamanne DonJayamanne merged commit 868d389 into main Jun 21, 2021
@DonJayamanne DonJayamanne deleted the issue6130 branch June 8, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants