mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
slash command altnames and support for ?
This commit is contained in:
@@ -119,9 +119,18 @@ export function useCompletion(
|
||||
// --- Handle Slash Command Completion ---
|
||||
if (trimmedQuery.startsWith('/')) {
|
||||
const partialCommand = trimmedQuery.substring(1);
|
||||
const filteredSuggestions = slashCommands
|
||||
const commands = slashCommands
|
||||
.map((cmd) => cmd.name)
|
||||
.concat(
|
||||
slashCommands
|
||||
.map((cmd) => cmd.altName)
|
||||
.filter((cmd) => cmd !== undefined),
|
||||
);
|
||||
|
||||
const filteredSuggestions = commands
|
||||
.filter((name) => name.startsWith(partialCommand))
|
||||
// Filter out ? and any other single character commands
|
||||
.filter((name) => name.length > 1)
|
||||
.map((name) => ({ label: name, value: name }))
|
||||
.sort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user