-
Notifications
You must be signed in to change notification settings - Fork 415
Reopen a notebook does not mark it as modified #2789
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
| return object !== null && typeof object === 'object'; | ||
| } | ||
| const objectKeys1 = Object.keys(object1); | ||
| const objectKeys2 = Object.keys(object2); |
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.
very minor nitpick: object1Keys and object2Keys may read slightly better
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.
good point
src/polyglot-notebooks-vscode-common/src/vscodeNotebookManagement.ts
Outdated
Show resolved
Hide resolved
| const notebook = vscode.workspace.notebookDocuments.find(d => d.uri === notebookUri); | ||
| if (notebook) { | ||
| const metadata = notebook.metadata; | ||
| const shouldUpdate = compare(metadata, documentMetadata); |
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 was wondering why we need to update when the metadata has not changed i.e. when compare returns true. Could you please describe what the fix is doing here (just for my own understanding :))?
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.
changed that code
| return succeeded; | ||
| } | ||
|
|
||
| export async function replaceNotebookMetadata(notebookUri: vscode.Uri, documentMetadata: { [key: string]: any }): Promise<boolean> { |
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.
Do we have tests for this method? This was a pretty annoying bug and a significant code change.
If not, it might be a good conversation about how we can test things like this.
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.
no it needs to be refactored to be testable
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.
You know I love to refactor!
956b4e5 to
e4431ad
Compare
026ec04 to
319871b
Compare
| "frontend" | ||
| ], | ||
| "languageName": null, | ||
| "name": "vscode" |
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.
Should this be in the list?
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.
it is one of the kernel present
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.
filtering out kernels not implementing submitcode
rework comparing and have tests notebooks notebooks notebooks notebooks notebooks notebook notebooks fix for ipynb notebooks notebooks notebooks notebooks wip sort objects when merging metadata handle documentKernelInfo at sorting too sorted sort and merge metadata rewrite object notebook notebooks notebooks notebook fix compiler error test
31ae590 to
656be8b
Compare
notebooks notebooks filter out kernel not supporting submitcode notebooks
d2841b5 to
322e1a8
Compare
src/polyglot-notebooks-vscode-common/src/notebookControllers.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Brett V. Forsgren <brettfo@microsoft.com>
| } | ||
|
|
||
| export function getRawNotebookDocumentMetadataFromNotebookDocumentMetadata(notebookDocumentMetadata: NotebookDocumentMetadata, createForIpynb: boolean): { [key: string]: any } { | ||
| export function getRawNotebookDocumentMetadataFromNotebookDocumentMetadata(notebookDocumentMetadata: NotebookDocumentMetadata, documentRawMetadata: { [key: string]: any }, createForIpynb: boolean): { [key: string]: any } { |
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.
It seems that this method is now doing more than one responsibility. Perhaps something like getAndMergetNotebookMetadata
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.
good point, renamed
No description provided.