Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileWillCreateEvent

An event that is fired when files are going to be created.

To make modifications to the workspace before the files are created, call the waitUntil-function with a thenable that resolves to a workspace edit.

Hierarchy

  • FileWillCreateEvent

Index

Properties(2)

Methods(1)

Properties(2)

Readonly token

A cancellation token.

Readonly files

files: readonly Uri[]

The files that are going to be created.

Methods(1)

waitUntil

  • Allows to pause the event and to apply a workspace edit.

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

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

    Parameters

    Returns void

  • Allows to pause the event until the provided thenable resolves.

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

    Parameters

    • thenable: Thenable<any>

      A thenable that delays saving.

    Returns void

Generated by TypeDoc. Maintained by 紫升

Links: 搜外友链, 69中文网