Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CustomTextEditorProvider

Hierarchy

  • CustomTextEditorProvider

Index

Methods

  • Handle when the underlying resource for a custom editor is renamed.

    This allows the webview for the editor be preserved throughout the rename. If this method is not implemented, Theia will destroy the previous custom editor and create a replacement one.

    Parameters

    • newDocument: TextDocument

      New text document to use for the custom editor.

    • existingWebviewPanel: WebviewPanel

      Webview panel for the custom editor.

    • token: CancellationToken

      A cancellation token that indicates the result is no longer needed.

    Returns Thenable<void>

    Thenable indicating that the webview editor has been moved.

  • Resolve a custom editor for a given text resource.

    This is called when a user first opens a resource for a CustomTextEditorProvider, or if they reopen an existing editor using this CustomTextEditorProvider.

    Parameters

    • document: TextDocument

      Document for the resource to resolve.

    • webviewPanel: WebviewPanel

      The webview panel used to display the editor UI for this resource.

      During resolve, the provider must fill in the initial html for the content webview panel and hook up all the event listeners on it that it is interested in. The provider can also hold onto the WebviewPanel to use later for example in a command. See WebviewPanel for additional details.

    • token: CancellationToken

      A cancellation token that indicates the result is no longer needed.

    Returns void | Thenable<void>

    Thenable indicating that the custom editor has been resolved.