KEMBAR78
Leverage fig's parser implementation · Issue #239519 · microsoft/vscode · GitHub
Skip to content

Leverage fig's parser implementation #239519

@Tyriar

Description

@Tyriar

Currently our fig spec integration is quite simple, basically we just pull top-level options, arguments and subcommands here:

const argsCompletionResult = handleArguments(specLabel, spec, terminalContext, precedingText);
if (argsCompletionResult) {
items.push(...argsCompletionResult.items);
filesRequested ||= argsCompletionResult.filesRequested;
foldersRequested ||= argsCompletionResult.foldersRequested;
}
if (!argsCompletionResult?.items.length) {
// Arg completions are more specific, only get options if those are not provided.
const optionsCompletionResult = handleOptions(specLabel, spec, terminalContext, precedingText, prefix);
if (optionsCompletionResult) {
items.push(...optionsCompletionResult.items);
filesRequested ||= optionsCompletionResult.filesRequested;
foldersRequested ||= optionsCompletionResult.foldersRequested;
}
}
const subcommands = handleSubcommands(specLabel, spec, terminalContext, precedingText, prefix);
if (subcommands) {
items.push(...subcommands.items);
filesRequested ||= subcommands.filesRequested;
foldersRequested ||= subcommands.foldersRequested;
}

We want to better support this in a way that we can leverage all the functionality it brings. Such as:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions