Avoid close cells on notebookDocument/didClose#11867
Closed
T-256 wants to merge 1 commit intoastral-sh:jane/server/defer-cell-index-deletionfrom
Closed
Avoid close cells on notebookDocument/didClose#11867T-256 wants to merge 1 commit intoastral-sh:jane/server/defer-cell-index-deletionfrom
notebookDocument/didClose#11867T-256 wants to merge 1 commit intoastral-sh:jane/server/defer-cell-index-deletionfrom
Conversation
MichaReiser
reviewed
Jun 14, 2024
| })?; | ||
| } | ||
| } | ||
| // notebook cells are closed via textDocument/didClose - we don't close them here. |
Member
There was a problem hiding this comment.
Does that mean that VS code sends an explicit didClose request before (or after) for the cells?
Contributor
Author
There was a problem hiding this comment.
Yes, it always will send textDocument/didClose either before or after.
- I noticed on regular
file://urls it sendstextDocument/didCloseper cell beforenotebookDocument/didClose:
2024-06-14 16:46:48.544 [info] [Trace - 4:46:48 PM] Sending notification 'textDocument/didClose'.
2024-06-14 16:46:48.544 [info] Params: {
"textDocument": {
"uri": "vscode-notebook-cell:/e%3A/test/test.ipynb#W0sZmlsZQ%3D%3D"
}
}
2024-06-14 16:46:48.544 [info] [Trace - 4:46:48 PM] Sending notification 'textDocument/didClose'.
2024-06-14 16:46:48.544 [info] Params: {
"textDocument": {
"uri": "vscode-notebook-cell:/e%3A/test/test.ipynb#W1sZmlsZQ%3D%3D"
}
}
2024-06-14 16:46:48.544 [info] [Trace - 4:46:48 PM] Sending notification 'notebookDocument/didClose'.
2024-06-14 16:46:48.544 [info] Params: {
"notebookDocument": {
"uri": "file:///e%3A/test/test.ipynb"
},
"cellTextDocuments": [
{
"uri": "vscode-notebook-cell:/e%3A/test/test.ipynb#W0sZmlsZQ%3D%3D"
},
{
"uri": "vscode-notebook-cell:/e%3A/test/test.ipynb#W1sZmlsZQ%3D%3D"
}
]
}
2024-06-14 16:46:48.545 [info] [Trace - 4:46:48 PM] Received notification 'textDocument/publishDiagnostics'.
2024-06-14 16:46:48.545 [info] Params: {
"diagnostics": [],
"uri": "vscode-notebook-cell:/e%3A/test/test.ipynb#W0sZmlsZQ%3D%3D",
"version": 2
}
2024-06-14 16:46:48.545 [info] [Trace - 4:46:48 PM] Received notification 'textDocument/publishDiagnostics'.
2024-06-14 16:46:48.545 [info] Params: {
"diagnostics": [],
"uri": "vscode-notebook-cell:/e%3A/test/test.ipynb#W1sZmlsZQ%3D%3D",
"version": 2
}
- For "untitled:Untitled-1.ipynb" and "untitled:/Interactive-2.interactive" urls it will send
textDocument/didCloseper cell afternotebookDocument/didClose:
2024-06-14 16:58:23.344 [info] [Trace - 4:58:23 PM] Sending notification 'notebookDocument/didClose'.
2024-06-14 16:58:23.344 [info] Params: {
"notebookDocument": {
"uri": "untitled:Untitled-1.ipynb?jupyter-notebook"
},
"cellTextDocuments": [
{
"uri": "vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D"
}
]
}
2024-06-14 16:58:23.364 [info] [Trace - 4:58:23 PM] Sending notification 'textDocument/didClose'.
2024-06-14 16:58:23.364 [info] Params: {
"textDocument": {
"uri": "vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D"
}
}
2024-06-14 16:58:23.365 [info] 1173.763966200s ERROR ruff:main ruff_server::server::api: An error occurred while running textDocument/didClose: Unable to take snapshot for document with URL vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D
2024-06-14 16:58:23.365 [info] [Trace - 4:58:23 PM] Received notification 'window/showMessage'.
2024-06-14 16:58:23.365 [info] Params: {
"message": "Ruff encountered a problem. Check the logs for more details.",
"type": 1
}
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #11651
Fixes #11851
As a follow-up of #11864
Test Plan
Close (Ctrl+F4) documents with type of notebook/interactive-window/untitled-notebook and check no popup error message shows.