@flowscripter/dynamic-cli-framework
    Preparing search index...

    Interface CompletionService

    Interface for a service providing shell auto-completion support.

    interface CompletionService {
        formatCompletions(
            shellType: ShellType,
            completions: readonly CompletionItem[],
        ): string;
        generateCompletions(
            shellType: ShellType,
            line: string,
            cursorPosition: number,
        ): Promise<readonly CompletionItem[]>;
        getBootstrapScript(
            shellType: ShellType,
            cliName: string,
            executablePath: string,
        ): string;
        getDefaultConfigPath(shellType: ShellType): string;
        parseCompletionContext(
            shellType: ShellType,
            args: readonly string[],
        ): { cursorPosition: number; line: string };
        validateShellEnvironment(shellType: ShellType): Promise<boolean>;
    }

    Implemented by

    Index
    • Parameters

      Returns string

    • Parameters

      • shellType: ShellType
      • line: string
      • cursorPosition: number

      Returns Promise<readonly CompletionItem[]>

    • Parameters

      • shellType: ShellType
      • cliName: string
      • executablePath: string

      Returns string

    • Parameters

      Returns string

    • Parse the arguments passed by a shell's completion bootstrap script into the command line being completed and the cursor position within it.

      Parameters

      • shellType: ShellType

        the shell which invoked completion.

      • args: readonly string[]

        the arguments passed by the shell's bootstrap script.

      Returns { cursorPosition: number; line: string }

      the command line being completed and the cursor position within it.

    • Parameters

      Returns Promise<boolean>