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

    LSP Tab completion provider for notebook cells. Provides dropdown menu completions (triggered by Tab key). Supports Python (via Pylance) and Markdown (via built-in VS Code markdown LSP).

    Index

    Constructors

    Properties

    identifier: "@datalayer/lsp-tab-provider"

    Unique identifier for this provider

    inflightCache: Map<string, Promise<any[]>> = ...

    Cache of in-flight requests to avoid duplicates (cacheKey -> Promise)

    messageHandlerDisposable: Disposable

    Message handler disposable for cleanup

    name: "LSP (Python & Markdown)"

    Human-readable name displayed in UI

    pendingRequests: Map<string, (items: any[]) => void> = ...

    Map of pending requests (requestId -> resolve function)

    rank: 600

    Provider rank - higher rank = higher priority (600 > kernel's 550)

    requestCounter: number = 0

    Request counter for generating unique IDs

    Methods

    • Fetch completion suggestions from LSP for dropdown menu.

      Parameters

      • request: IRequest

        Completion request with text and cursor position

      • context: any

        Completion context with widget, editor, session

      Returns Promise<ICompletionItemsReply<ICompletionItem>>

      Promise resolving to completion reply for dropdown

    • Check if this provider is applicable to the current context. Returns true for Python and Markdown cells (LSP works without kernel).

      Parameters

      • context: any

        Completion context with widget, editor, session

      Returns Promise<boolean>

      Promise resolving to true if provider should be used

    • Convert character offset to line/character position.

      Parameters

      • text: string

        The full text content

      • offset: number

        Character offset in the text

      Returns { character: number; line: number }

      Line and character position (0-indexed)

    • Convert line/character position to character offset.

      Parameters

      • text: string

        The full text content

      • position: { character: number; line: number }

        Line and character position

      Returns number

      Character offset in the text

    • Request completions from extension host via postMessage. Deduplicates identical requests to avoid spamming Pylance.

      Parameters

      • cellId: string
      • language: CellLanguage
      • position: { character: number; line: number }

      Returns Promise<any[]>