-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
base: main
Are you sure you want to change the base?
Conversation
This also fixes an issue where option values stopped working recently. Fixes #241392
Tests might fail |
@@ -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 }, |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
This also fixes an issue where option values stopped working recently.
Fixes #241392
Fixes #241412
We don't have the flag icon yet: