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

    VS Code LLM completion provider for Lexical cells. Bridges webview with extension host's Language Model API access.

    Communication flow:

    1. Lexical plugin calls fetch() with code context
    2. Provider sends message to extension host via vsCodeAPI
    3. Extension host calls VS Code Language Model API (Copilot)
    4. Response sent back via message passing
    5. Provider extracts new text (removes prefix overlap)
    6. Returns completion to Lexical plugin

    Implements

    • IInlineCompletionProvider
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    identifier: "@vscode/llm-copilot-lexical"

    Provider unique identifier

    name: "VS Code Copilot (Lexical)"

    Provider display name

    Methods

    • Fetches code completion from VS Code's Language Model API. Handles prefix overlap detection to return only new text.

      Parameters

      • request: CompletionRequest

        Code text and cursor position

      • context: CompletionContext

        Code before and after cursor

      Returns Promise<CompletionList>

      Promise with completion suggestions

      The LLM may return full completion including typed prefix. This method extracts only the new text to insert after cursor.

    • Requests completion from extension host via message passing. Implements request/response pattern with timeout protection.

      Parameters

      • prefix: string

        Code before cursor

      • suffix: string

        Code after cursor

      • language: string

        Programming language identifier

      Returns Promise<string>

      Completion text or null if timeout/error

      Uses request ID matching to correlate responses. Times out after 15 seconds to prevent hanging webview.