Skip to content

New notebook from the command line issues #125028

@bpasero

Description

@bpasero

The workbench distinguishes untitled editors:

  • without associated file path
  • with associated file path

The former is the usual untitled editor that you get when you pick File > New File and the editor will not appear dirty until you start typing contents. The latter is for the scenario of the user typing code <some path>/<some file> pointing to a file that does not exist. We then:

  • open an untitled editor with the associated file path
  • show the editor dirty even without typing contents
  • do not ask for a file path when saving (because we got a file path associated already).

This flow does not seem to work for notebooks yet. Steps to Reproduce:

  1. type code-insiders /<some path>/new.github-issues
  2. an untitled notebook opens

List of issues:

  • there is a "1 unsaved" indicator that is not originating from the notebook itself but what seems to be an untitled editor that probably was created in the beginning and overridden (caused by Editor overrides should work with untitled inputs (without resource) #124352 and I suggest we keep this issue there)
  • the notebook does not seem to have an associated file path because it does not appear dirty and it asks to for a file path when saving

@jrieken for this purpose the IUntitledFileWorkingCopyManager provides an overload to the resolve method called INewUntitledFileWorkingCopyWithAssociatedResourceOptions. If you pass on the path as associated resource, everything should work fine.

image

//cc @lramos15

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersnotebookverifiedVerification succeededworkbench-untitled-editorsManaging of untitled editors in workbench window

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions