-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Enabling persisting notebook kernel information in notebooks #130602
Comments
Fixes #130602 This adds a new API to the built-in ipynb extension that lets other extension set the kernelspec metadata on a notebook file
Fixes #130602 This adds a new API to the built-in ipynb extension that lets other extension set the kernelspec metadata on a notebook file
* Add API for setting kernelspec in ipynb files Fixes #130602 This adds a new API to the built-in ipynb extension that lets other extension set the kernelspec metadata on a notebook file * Temporarily skip the notebook editor tests We need the new webview content to be published before these can run * Use `custom` instead of top level property
To test:
const ext = vscode.extensions.getExtension('vscode.ipynb');
const api = await ext?.activate();
if (vscode.window.activeNotebookEditor) {
api.setKernelSpec(vscode.window.activeNotebookEditor.document.uri, { test: 'bla' });
}
I've been testing this using the |
Hm, not sure this api is doing the correct thing after following those steps again. Running against
The notebook should also be marked dirty after its metadata is changed. It currently is not @roblourens @jrieken Are you more familiar with the notebook editing api? Is it expected that |
It depends on the notebook serializer - they can mark what metadata is transient and what is persisted. This is how it is defined for our ipynb extension: vscode/extensions/ipynb/src/ipynbMain.ts Line 11 in 1dae051
|
For #130602 I think we need to write it into metadata section instead of the top level
@roblourens @DonJayamanne Pushed b2bbd76 that writes the kernelspec into the Also, I believe the ipynb serializer does not set |
I believe this line is why the notebook document is never marked dirty:
I don't really understand what it is doing but it always returns |
In the past all custom notebook metadata had to be set in a property named Unfortunately by that time .NET team and Jupyter team was already relying on The plan is to move away from that |
Fixed by #131681 and ported to the release branch See original verification steps: #130602 (comment) |
No description provided.
The text was updated successfully, but these errors were encountered: