Class PineSignatureHelpProvider

Provides signature help for Pine functions.

Implements

  • SignatureHelpProvider

Constructors

Properties

activeArg: null | string = null
activeFunction: null | string = null
activeParameter: null | number = null
activeSignature: number = 0
argsLength: number = 0
commaSwitch: number = 0
docsToMatchArgumentCompletions?: Map<string | number, PineDocsManager> = ...
document: undefined | TextDocument
hasEqual: boolean = false
isParamOrArg: boolean = false
keyValueMatchesSave: any = null
lastIndex: number = 0
lastSelection: null | string = null
line: string = ''
lineLength: number = 0
newFunction: boolean = false
offset: number = 0
paramIndexes: string[][] = []
position: Position = ...
signatureHelp: SignatureHelp = ...
usedParams: string[] = []

Methods

  • This method is used to build the parameters for a Pine function.

    Parameters

    • docs: any

      The Pine function for which parameters are to be built.

    • syn: string

      The syntax of the Pine function.

    Returns [ParameterInformation[], string[], Record<string, string>[], string]

    An array containing the parameter information, active signature help, and syntax.

  • Simplifies building signatures for a Pine function, focusing on readability.

    Parameters

    • docs: PineDocsManager

      Documentation manager with Pine function details.

    • isMethod: boolean = false

      Flag indicating if the target is a method.

    • methodString: null | string = null

      Optional method string for namespace extraction.

    Returns [SignatureInformation[], Record<string, string>[][], string[][]]

    Tuple with signature information, active signature helper data, and parameter indexes.

  • Calculates the active parameter based on the current line, position, and signatures. Assumes there are class variables like line, position, activeSignature, paramIndexes, and a method signatureHelp available.

    Returns number

    The index of the active parameter.

  • Calculates the active signature based on the current line, position, signature help, and active parameter. Assumes there are class variables like line, position, activeSignature, activeArg, and a method signatureHelp available.

    Parameters

    • activeSignatureHelper: Record<string, string>[][]

      The active signature helper data.

    Returns number

    The index of the active signature.

  • Checks the active argument.

    Parameters

    • arg: null | string = ...

      The argument to check.

    • index: number = 0

      The index of the argument.

    • recursive: boolean = false

      Flag indicating if the check is recursive.

    Returns number

    The index of the active argument.

  • Extracts completions from the given array.

    Parameters

    • possibleValues: string[]

      The array to extract completions from.

    • docs: null | Record<string, any>

      The documentation for the argument.

    • def: null | string | number

      The default value for the argument.

    • isString: boolean

      Flag indicating if the argument is a string.

    • paramArray: Record<string, any>[]

      The array of parameters.

    Returns Promise<any[]>

    An array of completions.

  • Finds the position of the given argument in the given string.

    Parameters

    • syntax: string

      The string to search.

    • arg: string

      The argument to find.

    Returns null | string | [number, number]

    The position of the argument in the string.

  • Gets the types of the arguments.

    Parameters

    • argDocs: Record<string, any>

      The documentation for the arguments.

    Returns any

    An array of argument types.

  • Provides signature help for a Pine function.

    Parameters

    • document: TextDocument

      The current document.

    • position: Position

      The current position within the document.

    • _token: CancellationToken

      A cancellation token.

    • _context: SignatureHelpContext

      The signature help context.

    Returns Promise<null | SignatureHelp>

    A SignatureHelp object or null.

  • Sends completion suggestions based on the active parameter in the signature help.

    Parameters

    • docs: Record<string, any>

      The documentation for the function.

    • activeSignatureHelper: Record<string, string>[]

      The active signature helper data.

    Returns Promise<void>

  • Sets the active argument in the shared completion state.

    Parameters

    • signatureHelp: SignatureHelp

      The signature help information.

    Returns Promise<void>

Generated using TypeDoc