mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
fix(cli): prioritize slash command completions (#3104)
This commit is contained in:
parent
4c67670ef0
commit
81ccbb976c
5 changed files with 308 additions and 14 deletions
|
|
@ -246,6 +246,36 @@ describe('useSlashCompletion', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should prefer higher completionPriority when match quality ties', async () => {
|
||||
const slashCommands = [
|
||||
createTestCommand({
|
||||
name: 'mock',
|
||||
description: 'Mock command',
|
||||
}),
|
||||
createTestCommand({
|
||||
name: 'model',
|
||||
description: 'Model command',
|
||||
completionPriority: 100,
|
||||
}),
|
||||
];
|
||||
|
||||
const { result } = renderHook(() =>
|
||||
useTestHarnessForSlashCompletion(
|
||||
true,
|
||||
'/mo',
|
||||
slashCommands,
|
||||
mockCommandContext,
|
||||
),
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.suggestions.map((s) => s.value)).toEqual([
|
||||
'model',
|
||||
'mock',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should suggest commands based on partial altNames', async () => {
|
||||
const slashCommands = [
|
||||
createTestCommand({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue