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

    Interface CustomReadonlyEditorProvider<T>

    Provider for readonly custom editors that use a custom document model.

    Custom editors use CustomDocument as their document model instead of a TextDocument.

    You should use this type of custom editor when dealing with binary files or more complex scenarios. For simple text based documents, use CustomTextEditorProvider instead.

    interface CustomReadonlyEditorProvider<
        T extends CustomDocument = CustomDocument,
    > {
        openCustomDocument(
            uri: Uri,
            openContext: CustomDocumentOpenContext,
            token: CancellationToken,
        ): T | Thenable<T>;
        resolveCustomEditor(
            document: T,
            webviewPanel: WebviewPanel,
            token: CancellationToken,
        ): void | Thenable<void>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Methods

    • Resolve a custom editor for a given resource.

      This is called whenever the user opens a new editor for this CustomEditorProvider.

      Parameters

      • document: T

        Document for the resource being resolved.

      • 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>

      Optional thenable indicating that the custom editor has been resolved.