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

    Bidirectional registry for document ID ↔ document URI mapping Handles both notebooks (.ipynb) and lexical documents (.lexical)

    Index

    Constructors

    Properties

    idToEntry: Map<string, DocumentRegistryEntry> = ...

    Map from documentId → entry

    • Local: "file:///path/to/doc.ipynb" → {id, uri, type: "notebook"}
    • Remote: "01KAJ42KE2XKM7NBNZV568KXQX" → {id, uri: "datalayer://...", type: "notebook"}
    uriToId: Map<string, string> = ...

    Map from documentUri → documentId Reverse lookup for when we have URI but need ID

    Methods

    • Get webview panel for active document Checks active custom editor tab (notebook or lexical)

      Returns WebviewPanel

      Webview panel or undefined if no active document with webview

    • Get all registered documents of a specific type

      Parameters

      • type: DocumentType

        Document type to filter by

      Returns DocumentRegistryEntry[]

      Array of registry entries

    • Get full registry entry for a document ID

      Parameters

      • documentId: string

        Document identifier

      Returns DocumentRegistryEntry

      Registry entry with id, uri, and type

      Error if documentId is not registered

    • Convert document URI to document ID

      Parameters

      • documentUri: string

        Document URI

      Returns string

      Document ID

      Error if documentUri is not registered

    • Get registry statistics

      Returns { lexicals: number; notebooks: number; total: number }

      • lexicals: number

        Number of registered lexical documents

      • notebooks: number

        Number of registered notebooks

      • total: number

        Total number of registered documents

    • Get document type (notebook or lexical)

      Parameters

      • documentId: string

        Document identifier

      Returns DocumentType

      Document type

      Error if documentId is not registered

    • Convert document ID to document URI

      Parameters

      • documentId: string

        Document identifier

      Returns string

      Document URI

      Error if documentId is not registered

    • Get webview panel for a document

      Parameters

      • documentUri: string

        Document URI

      Returns WebviewPanel

      Webview panel or undefined if not registered or no webview

    • Register a document with its ID, URI, and type

      Parameters

      • documentId: string

        Document identifier (UID for remote, URI for local)

      • documentUri: string

        VS Code document URI

      • type: DocumentType

        Document type (notebook or lexical)

      • OptionalwebviewPanel: WebviewPanel

        Optional webview panel for tool execution messaging

      Returns void