Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate flags/options, add option value type #241395

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Feb 20, 2025

This also fixes an issue where option values stopped working recently.

Fixes #241392
Fixes #241412


We don't have the flag icon yet:

image

image

This also fixes an issue where option values stopped working recently.

Fixes #241392
@Tyriar Tyriar added this to the February 2025 milestone Feb 20, 2025
@Tyriar Tyriar self-assigned this Feb 20, 2025
@Tyriar
Copy link
Member Author

Tyriar commented Feb 20, 2025

Tests might fail

@Tyriar Tyriar requested a review from meganrogge February 20, 2025 21:03
@Tyriar Tyriar marked this pull request as ready for review February 20, 2025 21:03
@Tyriar Tyriar enabled auto-merge February 20, 2025 21:04
@@ -66,7 +67,7 @@ export async function getFigSuggestions(
result.items.push(createCompletionItem(
terminalContext.cursorPosition,
prefix,
{ label: { label: specLabel, description } },
{ label: { label: specLabel, description }, kind: vscode.TerminalCompletionItemKind.Flag },
Copy link
Contributor

@meganrogge meganrogge Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a Method, not a Flag?

@@ -238,6 +239,10 @@ export async function collectCompletionItemResult(
}
const flagsToExclude = kind === vscode.TerminalCompletionItemKind.Flag ? parsedArguments?.passedOptions.map(option => option.name).flat() : undefined;
if (Array.isArray(specArgs)) {
let itemKind = kind;
if (parsedArguments?.currentArg?.suggestions?.length === specArgs.length) {
Copy link
Contributor

@meganrogge meganrogge Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment with an example of what specArgs and parsedArguments?.currentArg?.suggestions might be here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

options are missing for terminal suggestions Differentiate flag and option completion types
2 participants