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

    Service for registering and resolving pending image attachments.

    When images are pasted or dropped into the chat input, they are registered here with a short ID. The short ID can be used in the text input (e.g., #imageContext:img_1) while the actual base64 data is stored in this registry.

    This allows:

    • The hover provider to look up image data for previews
    • The variable resolver to expand short IDs to full image data when sending
    • Proper scoping by model ID so multiple chat inputs don't interfere

    Implements

    Index

    Constructors

    Properties

    editorToModelMap: Map<string, string> = ...

    Map of editor URI -> model ID for hover provider lookups

    globalShortIdMap: Map<string, PendingImageData> = ...

    Global map of short ID -> image data for fallback lookups when scope is unavailable

    registry: Map<string, Map<string, PendingImageData>> = ...

    Map of scope URI -> (short ID -> image data)

    Methods

    • Generate a unique short ID for a pending image based on a base name. For dropped files, use the basename (e.g., "photo.png"). For pasted images, use "pasted_image". If duplicates exist, a numeric suffix is added (e.g., "photo_2.png", "pasted_image_2").

      Parameters

      • baseName: string

        The base name to use for the short ID

      • scopeUri: string

        The scope URI to check for duplicates

      Returns string

      A unique short ID within the given scope