Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/runtime/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const getSuggestions = async (cmd: string, cwd: string, shell: Shell): Pr
}
const result = await runSubcommand(activeCmd.slice(1), subcommand, resolvedCwd, shell);
if (result == null) return;
if (result.suggestions.length == 0 && !result.argumentDescription) return;

const charactersToDrop = lastCommand?.complete ? 0 : lastCommand?.tokenLength;
return { ...result, charactersToDrop };
Expand Down
14 changes: 2 additions & 12 deletions src/tests/runtime/__snapshots__/runtime.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,7 @@ exports[`parseCommand completedOptionWithArg 1`] = `
}
`;

exports[`parseCommand emptySuggestions 1`] = `
{
"charactersToDrop": 2,
"suggestions": [],
}
`;
exports[`parseCommand emptySuggestions 1`] = `undefined`;

exports[`parseCommand exclusiveOnOption 1`] = `
{
Expand Down Expand Up @@ -528,12 +523,7 @@ exports[`parseCommand noArgsArgumentGiven 1`] = `
}
`;

exports[`parseCommand noOptionsSuggestedDuringVariadicArg 1`] = `
{
"charactersToDrop": 3,
"suggestions": [],
}
`;
exports[`parseCommand noOptionsSuggestedDuringVariadicArg 1`] = `undefined`;

exports[`parseCommand optionsSuggestedAfterVariadicArg 1`] = `
{
Expand Down
Loading