-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support hot exit storage for untitled notebooks #11891
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
|
|
||
| const MEMENTO_KEY = 'nativeEditorViewTracking'; | ||
| @injectable() | ||
| export class NativeEditorViewTracker implements IExtensionSingleActivationService { |
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.
Whoops, need a class comment. #Resolved
|
Kudos, SonarCloud Quality Gate passed!
|
| return registeredProvider; | ||
| } | ||
|
|
||
| test('Opening a notebook', async () => { |
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.
These tests used to be unit tests, but I changed them to functional so that they would test more of the storage code at once.
| await this.fileSystem.createDirectory(path.dirname(filePath)); | ||
| if (!cancelToken?.isCancellationRequested) { | ||
| return this.fileSystem.writeFile(filePath, contents); | ||
| return await this.fileSystem.writeFile(filePath, contents); |
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.
Why did you need the awaits on the returns here?
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.
So that exceptions stay within the try block
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.
This is the situation I explained in a friday meeting a while back.
|
Gentlemen, FYI this implementation is very buggy. If I have one or more notebooks open, eg: and I close and reopen vscode (insiders edition) I get this: I think to myself "Hmm, that's weird... the notebook didn't reopen". I then proceed to open the notebook manually and all of a sudden I now have two copies of the same notebook: 😨 This is also exacerbated by the fact that both of the notebooks are marked with the asterisk (*) even though I didn't make any changes (as in screenshots above). |
|
This is a side effect of our extension not 'loading' when you reopen. You have to open some other file or run some Python command to get the extension to load. Then the files open. We likely need some help from VS code to fix this (or just wait for us to switch to the new VS code notebook api). We need for them to provide a way for us to auto load only in certain circumstances. See this issue here: |
|
@rchiodo thank you for the clarification. I guess this is another thing pivoting around #7903 😞 |
Yep, that would fix it too as we wouldn't need to have our own way to open the files. |



For #11711
Make it so we use hot exit storage for untitled files too.
In addition to this (since you can't open an untitled file), open all unclosed notebooks on reopen of the extension.