-
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.
src/vs/workbench/contrib/positronNotebook/browser/PositronNotebookComponent.tsx
Show resolved
Hide resolved
…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
src/vs/workbench/contrib/positronNotebook/browser/positronNotebook.contribution.ts
Outdated
Show resolved
Hide resolved
// the editor has been closed (see https://github.com/positron/issues/XXXXX). | ||
const ref = await this.notebookModelResolverService.resolve({ untitledResource: resource }, viewType); | ||
const resolvedResource = ref.object.resource; | ||
ref.dispose(); |
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.
okay here's another weird one - now when I click New File > Jupyter Notebook, it opens a VSC notebook even though my preference is Positron. When I save it, it switches to Positron. 🙃
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.
Wait really?
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 you have a video of that happening? That's the behavior before this at least. It's not happening on my side.
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'm also encountering the issues @austin3dickey mentioned.
When I create a new notebook with the Create: Jupyter Notebook command, the notebook editor tab doesn't show the dirty indicator.
When I edit the notebook, it does show the dirty indicator but also spawns a VSCode notebook editor of the same file.
Screen.Recording.2025-07-25.at.16.14.43.mov
Saving the notebook closes both editors:
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.