Datalayer VS Code Extension - v0.0.17
    Preparing search index...

    Custom editor provider for Lexical documents. Handles webview lifecycle management, document state synchronization, and collaboration features for rich text editing.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _callbacks: Map<string | number, (response: unknown) => void> = ...

    Map of request ID to response callbacks for request/response message pattern.

    _context: ExtensionContext

    VS Code extension context providing access to storage, subscriptions, etc.

    _messageRouter: DocumentMessageRouter

    Message router for handling webview messages and routing to appropriate handlers.

    _networkBridge: NetworkBridgeService

    Network bridge service for HTTP/WebSocket communication between extension and webview.

    _onDidChangeCustomDocument: EventEmitter<
        CustomDocumentEditEvent<LexicalDocument>,
    > = ...

    Event emitter for document changes. Subclasses should fire this event when documents change.

    _runners: Map<WebviewPanel, Runner> = ...

    Map of webview panels to their Runner instances. Runners handle tool execution via the BridgeExecutor pattern.

    _runtimeBridge: RuntimeBridgeService

    Runtime bridge service for managing runtime lifecycle and selection.

    onDidChangeCustomDocument: Event<CustomDocumentEditEvent<LexicalDocument>> = ...

    Event for document changes (required by CustomEditorProvider interface).

    Methods

    • Creates a backup of a custom document for crash recovery.

      Parameters

      • document: LexicalDocument

        Lexical document to backup.

      • context: CustomDocumentBackupContext

        Backup context with destination URI.

      • cancellation: CancellationToken

        Cancellation token for aborting the backup.

      Returns Thenable<CustomDocumentBackup>

      Promise resolving to backup descriptor with cleanup function.

    • Initializes a Runner for a webview panel. Subclasses should call this in their resolveCustomEditor implementation.

      The Runner uses a BridgeExecutor to send tool execution requests to the webview, where they are executed by the webview's own Runner with DefaultExecutor.

      Parameters

      • webviewPanel: WebviewPanel

        The webview panel to create a Runner for.

      Returns Promise<Runner>

      The created Runner instance.

    • Opens a custom document for the lexical editor.

      Parameters

      • uri: Uri

        Document URI to open.

      • openContext: { backupId?: string }

        Context including backup information.

        • OptionalbackupId?: string

          Optional backup identifier for restoration.

      • _token: CancellationToken

        Cancellation token for aborting the operation.

      Returns Promise<LexicalDocument>

      Promise resolving to the lexical document.

    • Posts a message to the webview without expecting a response.

      Parameters

      • panel: WebviewPanel

        Target webview panel to send the message to.

      • type: string

        Message type identifier for routing.

      • body: unknown

        Message payload data.

      • Optionalid: string

        Optional message identifier for tracking.

      Returns void

    • Posts a message to the webview and waits for a response. Uses the request/response pattern with requestId tracking.

      Type Parameters

      • R = unknown

      Parameters

      • panel: WebviewPanel

        Target webview panel to send the message to.

      • type: string

        Message type identifier for routing.

      • body: unknown

        Message payload data.

      Returns Promise<R>

      Promise resolving to the webview response.

    • Refreshes collaboration config for all active webviews. Called when auth state changes (login/logout) to update usernames.

      Returns Promise<void>

    • Resolves a custom editor by setting up the webview and initializing collaboration.

      Parameters

      • document: LexicalDocument

        The lexical document to display.

      • webviewPanel: WebviewPanel

        The webview panel for the editor.

      • _token: CancellationToken

        Cancellation token for aborting the operation.

      Returns Promise<void>

      Promise that resolves when the editor is ready.

    • Saves a custom document to a new location.

      Parameters

      • document: LexicalDocument

        Lexical document to save.

      • destination: Uri

        Target URI for the saved copy.

      • cancellation: CancellationToken

        Cancellation token for aborting the save.

      Returns Thenable<void>

      Promise that resolves when the save is complete.

    • Sends a message to a specific Lexical webview identified by document URI.

      Parameters

      • uri: Uri

        Document URI identifying the target webview.

      • message: unknown

        Message object to post to the webview.

      Returns Promise<void>

    • Sends a message to a specific Lexical webview and waits for a response.

      Parameters

      • uri: Uri

        Document URI identifying the target webview.

      • message: unknown

        Message object to post to the webview.

      • requestId: string

        Unique ID to correlate the response with this request.

      Returns Promise<unknown>

      Promise resolving to the webview's response.

    • Registers the Lexical editor provider and commands with VS Code.

      Parameters

      • context: ExtensionContext

        Extension context for resource management.

      Returns Disposable

      Disposable for cleanup.