vscode: Untitled file service doesn't work with notebook view types
- VS Code Version: Insiders
- OS Version: Windows
Steps to Reproduce:
- Currently developing the .NET Interactive Notebooks extension (ms-dotnettools.dotnet-interactive-vscode)
- Our extension registers the notebook view type
dotnet-interactivefor files of type*.dib. - When we try to create a new untitled notebook, we get an error:
The file working copy resource untitled:Untitled-1.dib does not have an associated file system provider.
The following all fail in similar ways and all have the following code immediately preceeding this failure:
const viewType = 'dotnet-interactive'; // this was registered in `package.json`
const fileName = 'Untitled-1.dib'; // note, there is no existing editor with this name
const newUri = vscode.Uri.file(fileName).with({ scheme: 'untitled', path: fileName });
vscode.commands.executeCommand('vscode.openWith', newUri);vscode.commands.executeCommand('vscode.openWith', newUri, viewType);vscode.notebook.openNotebookDocument(newUri);
This one just opens a text document, not a notebook:
vscode.commands.executeCommand('workbench.action.files.newUntitledFile', viewType);
Does this issue occur when all extensions are disabled?: N/A
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (14 by maintainers)
Commits related to this issue
- make sure "Open With..." actually works..., maybe https://github.com/microsoft/vscode/issues/121974 or maybe https://github.com/microsoft/vscode/issues/121904 — committed to microsoft/vscode by jrieken 3 years ago
- wrap `NotebookSerializer` on insiders This is to enable new untitled notebooks to be .dib instead of .ipynb to work around this bug: https://github.com/microsoft/vscode/issues/121974 — committed to brettfo/interactive by brettfo 3 years ago
- wrap `NotebookSerializer` on insiders (#1301) This is to enable new untitled notebooks to be .dib instead of .ipynb to work around this bug: https://github.com/microsoft/vscode/issues/121974 — committed to dotnet/interactive by brettfo 3 years ago
- Squashed 'lib/vscode/' changes from 3c4e3df9e89..631dbe250bc 631dbe250bc Merge pull request #122730 from microsoft/tyriar/121282 166d7fe44d9 Ensure inline action applies to terminal out of selection ... — committed to coder/code-server by deleted user 3 years ago
- add API to open an untitled notebook, https://github.com/microsoft/vscode/issues/121974 — committed to microsoft/vscode by jrieken 3 years ago
- mark untitled notebooks as dirty by default, don't hold on to untitled notebooks eagerly, https://github.com/microsoft/vscode/issues/121974 — committed to microsoft/vscode by jrieken 3 years ago
- slightly better uri for untitled notebooks, https://github.com/microsoft/vscode/issues/121974 — committed to microsoft/vscode by jrieken 3 years ago
- try to use suffix for view type when creating untitled notebook, fyi @brettfo, https://github.com/microsoft/vscode/issues/121974 — committed to microsoft/vscode by jrieken 3 years ago
- Squashed 'lib/vscode/' changes from cfa2e218100..2064d4c301c 2064d4c301c fix issue reporter unit tests d99a697eb52 Fix #125503 b098b10a77e Merge branch 'notebook/dev' into main a57e41b7a43 notebooks:... — committed to coder/code-server by deleted user 3 years ago
Close as done
API proposal for creating untitled notebooks:
The old API will stay around but we aren’t planning to finalize it any time soon and aren’t planning to fix issues for it
Independent on how we are going to implement the internals: on the API-level we should have something like
openNotebookDocument({viewType: string, content?: Unit8Array })which then allows to create a new, untitled notebook for a given view type and with some content