import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation"; import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { type ITerminalCapabilityStore } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities"; import { TerminalShellType } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal"; import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service"; import { type ITerminalCompletion } from "./terminalCompletionItem.js"; import type { IProcessEnvironment } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform"; import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service"; import { IRelativePattern } from "@codingame/monaco-vscode-api/vscode/vs/base/common/glob"; import { ITerminalCompletionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/suggest/browser/terminalCompletionService.service"; /** * Represents a collection of {@link CompletionItem completion items} to be presented * in the terminal. */ export declare class TerminalCompletionList { /** * Resources should be shown in the completions list */ resourceOptions?: TerminalCompletionResourceOptions; /** * The completion items. */ items?: ITerminalCompletion[]; /** * Creates a new completion list. * * @param items The completion items. * @param isIncomplete The list is not complete. */ constructor(items?: ITerminalCompletion[], resourceOptions?: TerminalCompletionResourceOptions); } export interface TerminalCompletionResourceOptions { showFiles?: boolean; showDirectories?: boolean; globPattern?: string | IRelativePattern; cwd: UriComponents; pathSeparator: string; } export interface ITerminalCompletionProvider { id: string; shellTypes?: TerminalShellType[]; provideCompletions(value: string, cursorPosition: number, token: CancellationToken): Promise | undefined>; triggerCharacters?: string[]; isBuiltin?: boolean; } export declare class TerminalCompletionService extends Disposable implements ITerminalCompletionService { private readonly _configurationService; private readonly _fileService; private readonly _labelService; private readonly _logService; _serviceBrand: undefined; private readonly _providers; private readonly _onDidChangeProviders; readonly onDidChangeProviders: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event; get providers(): IterableIterator; private _providersGenerator; /** Overrides the environment for testing purposes. */ set processEnv(env: IProcessEnvironment); private _processEnv; constructor(_configurationService: IConfigurationService, _fileService: IFileService, _labelService: ILabelService, _logService: ITerminalLogService); registerTerminalCompletionProvider(extensionIdentifier: string, id: string, provider: ITerminalCompletionProvider, ...triggerCharacters: string[]): IDisposable; provideCompletions(promptValue: string, cursorPosition: number, allowFallbackCompletions: boolean, shellType: TerminalShellType | undefined, capabilities: ITerminalCapabilityStore, token: CancellationToken, triggerCharacter?: boolean, skipExtensionCompletions?: boolean, explicitlyInvoked?: boolean): Promise; protected _getEnabledProviders(providers: ITerminalCompletionProvider[]): ITerminalCompletionProvider[]; private _collectCompletions; resolveResources(resourceOptions: TerminalCompletionResourceOptions, promptValue: string, cursorPosition: number, provider: string, capabilities: ITerminalCapabilityStore, shellType?: TerminalShellType): Promise; private _getEnvVar; private _getHomeDir; } /** * Escapes special characters in a file/folder label for shell completion. * This ensures that characters like [, ], etc. are properly escaped. */ export declare function escapeTerminalCompletionLabel(label: string, shellType: TerminalShellType | undefined, pathSeparator: string): string;