Class PineScriptList

PineScriptList class is responsible for managing a list of Pine Scripts.

Constructors

Properties

defaultIcon: Uri = ...

Holds the URI of the default icon

existingFileUri: undefined | Uri

Holds the URI of an existing file

libraryIcon: Uri = ...

Holds the URI of the library icon

newExistingFileUri: undefined | Uri

Holds the URI of a new existing file

scriptList: any[] = []

Holds the list of scripts

strategyIcon: Uri = ...

Holds the URI of the strategy icon

studyIcon: Uri = ...

Holds the URI of the study icon

Methods

  • Populates the script list with the user's saved scripts.

    Parameters

    • scriptList: QuickPickItem[]

      The list of scripts.

    Returns Promise<void>

  • Creates a directory if it does not exist.

    Parameters

    • dirPath: string

      The path of the directory to create.

    Returns Promise<void>

  • Ensures that the given directory exists, creating it if necessary.

    Parameters

    • dirPath: string

      The path to the directory.

    Returns Promise<void>

  • Returns the list of scripts.

    Returns Promise<any[]>

    A promise that resolves to the list of scripts.

  • Handles the Pine script response.

    Parameters

    • response: any

      The response object containing the script details.

    Returns Promise<void>

  • Loads the script list.

    Parameters

    • toFetch: string

      The type of scripts to fetch ('saved' or 'built-in').

    Returns Promise<QuickPick<QuickPickItem>>

    A promise that resolves to the Quick Pick menu.

  • Opens a document with the given file URI.

    Parameters

    • fileUri: Uri

      The URI of the file to open.

    Returns Promise<void>

  • Opens a script with the given name, script ID part, and version.

    Parameters

    • scriptIdPart: string

      The script ID part of the script to open.

    • version: string

      The version of the script to open.

    • toFetch: string = 'saved'

      The type of scripts to fetch ('saved' or 'built-in').

    Returns Promise<any>

  • Processes an existing file by renaming it with a unique number suffix if a file with the same name already exists.

    Parameters

    • existingFileUri: Uri

      The URI of the existing file.

    • scriptDir: string

      The directory of the script.

    • name: string

      The name of the script.

    • newContent: string

      The new content of the script.

    Returns Promise<void>

  • Shows a menu to select a script to open.

    Parameters

    • toFetch: string

      The type of scripts to fetch ('saved' or 'built-in').

    Returns Promise<void>

Generated using TypeDoc