MCPcopy Create free account
hub / github.com/continuedev/continue / getFilteredCommands

Function getFilteredCommands

extensions/cli/src/ui/UserInput.tsx:354–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

352
353 // Get filtered commands for navigation - using the same sorting logic as SlashCommandUI
354 const getFilteredCommands = () => {
355 return slashCommands
356 .filter((cmd) =>
357 cmd.name.toLowerCase().includes(slashCommandFilter.toLowerCase()),
358 )
359 .sort((a, b) => {
360 const aStartsWith = a.name
361 .toLowerCase()
362 .startsWith(slashCommandFilter.toLowerCase());
363 const bStartsWith = b.name
364 .toLowerCase()
365 .startsWith(slashCommandFilter.toLowerCase());
366
367 if (aStartsWith && !bStartsWith) return -1;
368 if (!aStartsWith && bStartsWith) return 1;
369
370 return a.name.localeCompare(b.name);
371 });
372 };
373
374 // Handle slash command selection
375 const selectSlashCommand = (commandName: string) => {

Callers 1

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected