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

    Function registerCustomEditorProvider

    • Register a provider for custom editors for the viewType contributed by the customEditors extension point.

      When a custom editor is opened, Theia fires an onCustomEditor:viewType activation event. Your extension must register a CustomTextEditorProvider, CustomReadonlyEditorProvider, CustomEditorProviderfor viewType as part of activation.

      Parameters

      • viewType: string

        Unique identifier for the custom editor provider. This should match the viewType from the customEditors contribution point.

      • provider:
            | CustomTextEditorProvider
            | CustomReadonlyEditorProvider<CustomDocument>
            | CustomEditorProvider<CustomDocument>

        Provider that resolves custom editors.

      • Optionaloptions: {
            supportsMultipleEditorsPerDocument?: boolean;
            webviewOptions?: WebviewPanelOptions;
        }

        Options for the provider.

        • Optional ReadonlysupportsMultipleEditorsPerDocument?: boolean

          Only applies to CustomReadonlyEditorProvider | CustomEditorProvider.

          Indicates that the provider allows multiple editor instances to be open at the same time for the same resource.

          By default, Theia only allows one editor instance to be open at a time for each resource. If the user tries to open a second editor instance for the resource, the first one is instead moved to where the second one was to be opened.

          When supportsMultipleEditorsPerDocument is enabled, users can split and create copies of the custom editor. In this case, the custom editor must make sure it can properly synchronize the states of all editor instances for a resource so that they are consistent.

        • Optional ReadonlywebviewOptions?: WebviewPanelOptions

          Content settings for the webview panels created for this custom editor.

      Returns Disposable

      Disposable that unregisters the provider.