-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle reloading of REPL Window #24148
base: main
Are you sure you want to change the base?
Conversation
if (this.notebookDocument && nb.uri.toString() === this.notebookDocument.uri.toString()) { | ||
this.notebookDocument = undefined; | ||
this.newReplSession = true; | ||
this.replUri = undefined; | ||
await this.context.globalState.update(NATIVE_REPL_URI_MEMENTO, undefined); |
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.
For the edge case:
create repl, reload repl, close tab, then open notebook, and then we fall into trap where we think notebook is repl.
I dont think we have to worry about this since I set the replUri and memento for native repl to undefined as I watch for notebook document closing. @amunger
Screen.Recording.2024-11-13.at.4.35.56.PM.mov
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.
one more step to test the edge case: create another repl and make sure it doesn't recover "into" the untitled notebook
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.
to make it even more air tight, disable the python extension before reloading, and re-enable after creating the untitled notebook. That would simulate closing the tab before the python extension activated. At that point you would probably also need to check the label.
- create repl
- disable python extension
- reload vs code
- close the repl tab
- create new notebook
- enable python extension
- create python repl
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.
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.
I think the only place Python extension does anything with tab name is:
asRepl: 'Python REPL', |
when we call showNotebookDocument and pass 'Python REPL' as asRepl here
export interface NotebookDocumentShowOptions {
/**
* The notebook should be opened in a REPL editor,
* where the last cell of the notebook is an input box and the other cells are the read-only history.
* When the value is a string, it will be used as the label for the editor tab.
*/
readonly asRepl?: boolean | string | {
Could this is bug in the NotebookDocumentShowOptions or showNotebook document where tab name somehow gets lost? @amunger
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.
Resolves: #24021