-
Notifications
You must be signed in to change notification settings - Fork 108
PositroNB-untitled-notebook-support #8608
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
base: main
Are you sure you want to change the base?
Conversation
E2E Tests 🚀 |
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.
Go to Settings and enable
positron.notebooks.usePositronNotebooks
This isn't correct anymore, right? When testing this change I first used "Open with..." on an existing notebook and did "configure default editor". Then when I created a new notebook it successfully opened in the PositroNB editor.
extensions/ipynb/src/ipynbMain.ts
Outdated
} | ||
} catch (error) { | ||
// Fallback to the original approach if the above fails | ||
console.warn('Failed to open notebook via vscode.open, falling back to workspace API:', error); |
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.
Is there a better log than console
here? (I'm still trying to figure out when to use what logger 😂)
src/vs/workbench/contrib/positronNotebook/browser/PositronNotebookComponent.tsx
Show resolved
Hide resolved
extensions/ipynb/src/ipynbMain.ts
Outdated
]); | ||
await vscode.workspace.applyEdit(edit); | ||
} | ||
} catch (error) { |
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.
(adding a line comment so we can use a thread)
I'm seeing some strange behavior around saving these untitled notebooks. Sometimes when I save, the editor closes, which is unexpected. Sometimes it doesn't close, but the filename doesn't change (it stays untitled), and the saved file doesn't have any content in it, even if my editor does have content. Can you reproduce?
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.
Also, if I have an Untitled-1.ipynb in the workspace, and I open a new untitled notebook, its name is also Untitled-1.ipynb, which is probably not great.
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.
here's a recording with all 3 problems:
- new Untitled-1.ipynb with an Untitled-1.ipynb already in the workspace
- when I save asdasd-1.ipynb, it closes (leaving the phantom vs code nb from Run-all button when using positron notebooks causes another tab to open with vsc notebooks #8535 on the screen)
- then when I create a new one and save as asdasdasd-1.ipynb (sorry for the naming lol) it saves it as an empty file even though the untitled file I had up had 1 cell in it
Screen.Recording.2025-07-22.at.13.36.26.mov
…nNotebookContribution
…ate notebook editor.
…with preferred editors
…low for non-positron notebooks to avoid bugs
475215d
to
c6095f5
Compare
Remove global state and complex counter management in favor of simple collision detection starting from 1. Eliminates memory leaks and race conditions while maintaining standard VS Code numbering behavior.
- Properly dispose editor model reference in PositronNotebookEditorInput - Fix model reference leak by disposing immediately after getting resolved resource - Remove unused Event import in positronNotebook.contribution.ts
Test verifies that multiple untitled Positron notebooks get unique URIs and that URIs are properly reused when notebooks are closed
Addresses #3492.
@:notebooks
Fixes errors when creating new notebooks with Positron Notebooks enabled by intercepting untitled notebook files and routing them to the appropriate Positron notebook editor. This change ensures that new Jupyter notebooks created via "New File > Jupyter Notebook" properly initialize without console errors and maintain kernel connectivity.
Release Notes
New Features
Bug Fixes
QA Notes
Enable the Positron Notebooks configuration setting and create a new notebook file. The notebook should open without errors and maintain proper kernel connectivity.