-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Better handling of notebook diagnostics #16529
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
Conversation
|
|
||
| private onDidChangeCellsEmitter = new EventEmitter<TextDocumentChangeEvent>(); | ||
|
|
||
| private mapOfConcatDocumentsWithCellUris = new Map<string, string[]>(); |
There was a problem hiding this comment.
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), [])); |
There was a problem hiding this comment.
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, [])); |
There was a problem hiding this comment.
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.
Fixes some long standing issues in microsoft/vscode-jupyter#5161