-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ruff server
: Closing an untitled, unsaved notebook document no long…
…er throws an error (#11942) ## Summary Fixes #11651. Fixes #11851. We were double-closing a notebook document from the index, once in `textDocument/didClose` and then in the `notebookDocument/didClose` handler. The second time this happens, taking a snapshot fails. I've rewritten how we handle snapshots for closing notebooks / notebook cells so that any failure is simply logged instead of propagating upwards. This implementation works consistently even if we don't receive `textDocument/didClose` notifications for each specific cell, since they get closed (and the diagnostics get cleared) in the notebook document removal process. ## Test Plan 1. Open an untitled, unsaved notebook with the `Create: New Jupyter Notebook` command from the VS Code command palette (`Ctrl/Cmd + Shift + P`) 2. Without saving the document, close it. 3. No error popup should appear. 4. Run the debug command (`Ruff: print debug information`) to confirm that there are no open documents
- Loading branch information
1 parent
3d0230f
commit 791f6a1
Showing
3 changed files
with
11 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters