Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface NotebookDocumentWillSaveEvent

An event that is fired when a notebook document will be saved.

To make modifications to the document before it is being saved, call the waitUntil-function with a thenable that resolves to a workspace edit.

Hierarchy

  • NotebookDocumentWillSaveEvent

Index

Properties

The notebook document that will be saved.

stubbed

The reason why save was triggered.

stubbed

A cancellation token.

stubbed

Methods

  • Allows to pause the event loop and to apply workspace edit. Edits of subsequent calls to this function will be applied in order. The edits will be ignored if concurrent modifications of the notebook document happened.

    Note: This function can only be called during event dispatch and not in an asynchronous manner:

    workspace.onWillSaveNotebookDocument(event => {
    // async, will *throw* an error
    setTimeout(() => event.waitUntil(promise));

    // sync, OK
    event.waitUntil(promise);
    })
    stubbed

    Parameters

    Returns void

  • Allows to pause the event loop until the provided thenable resolved.

    Note: This function can only be called during event dispatch.

    stubbed

    Parameters

    • thenable: Thenable<any>

      A thenable that delays saving.

    Returns void