KEMBAR78
Improve workspace API for Notebook lifecycle to support (at least) saving events · Issue #130799 · microsoft/vscode · GitHub
Skip to content

Improve workspace API for Notebook lifecycle to support (at least) saving events #130799

@francisco-perez-sorrosal

Description

There are certain VSCode extensions that are devoted to allow users to define shell commands that are executed when files are saved. These include, among others, the following:

  1. Run on Save
  2. VSCode Run on Save
  3. Save and Run

The extensions above rely on events currently available in the VSCode workspace API such as onWillSaveTextDocument and onDidSaveTextDocument.

In the recently added native support for notebooks in VSCode, it looks like notebooks are treated in a different way than text documents. The new workspace API has included some events specifically targeted to the notebook lifecycle, such as onDidOpenNotebookDocument and onDidCloseNotebookDocument. However, the API currently lacks other useful notebook lifecycle events such as onWillSaveNotebookDocument and onDidSaveNotebookDocument, so the extensions above can't work properly when save-related events happen on notebooks.

Would it be possible to extend the workspace API with at least onWillSaveNotebookDocument and onDidSaveNotebookDocument (and other useful methods for the notebook lifecycle if possible)?

Thanks in advance!!!

Note: I've just stumbled upon a similar request for those APIs in an issue related to LiveShare: #102503

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions