Theia API Documentation v1.65.0
    Preparing search index...

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

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

    interface FileWillRenameEvent {
        files: readonly { newUri: Uri; oldUri: Uri }[];
        token: CancellationToken;
        waitUntil(thenable: Thenable<WorkspaceEdit>): void;
        waitUntil(thenable: Thenable<any>): void;
    }
    Index

    Properties

    Methods

    Properties

    files: readonly { newUri: Uri; oldUri: Uri }[]

    The files that are going to be renamed.

    A cancellation token.

    Methods

    • 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