Class PineLibHoverProvider

PineLibHoverProvider is a class that implements the vscode.HoverProvider interface. It provides hover information for Pine Script library imports in a Visual Studio Code document.

The class has properties for the Pine and TradingView icons, the TradingView URL, and a cache for hover data. The icons and URL are used in the hover information, and the cache is used to store hover information for each line of text. This allows the hover information to be retrieved quickly with only needing to be fetched once faster and only a single request to TV.

Implements

  • HoverProvider

Constructors

Properties

hoverCache: Map<string, null | Hover> = ...

Methods

  • This method builds a markdown string for a given script and library data.

    Parameters

    • scriptName: string

      The name of the script.

    • version: string

      The version of the script.

    • docs: string

      The documentation of the script.

    • user: string

      The user who created the script.

    • chartId: string

      The ID of the chart that the script is associated with.

    • source: string

      The source code of the script.

    Returns string

    A markdown string.

  • This method creates a Hover object for a given script and library data.

    Parameters

    • scriptContent: any

      The content of the script.

    • libData: any

      The data of the library.

    • position: Position

      The position at which the hover was requested.

    • document: TextDocument

      The document in which the hover was requested.

    Returns null | Hover

    A Hover object, or null if no word range is found at the position.

  • This method provides hover information for a given position in a document.

    Parameters

    • document: TextDocument

      The document in which the hover was requested.

    • position: Position

      The position at which the hover was requested.

    Returns Promise<undefined | null | Hover>

    A promise that resolves to a Hover object, or null if no hover information is available.

Generated using TypeDoc