Add autocomplete for slash commands

This commit is contained in:
Seth Troisi
2025-05-01 00:52:01 +00:00
parent f237082c37
commit cc838fad44
4 changed files with 62 additions and 17 deletions

View File

@@ -26,7 +26,7 @@ import { ConsoleOutput } from './components/ConsolePatcher.js';
import { HistoryItemDisplay } from './components/HistoryItemDisplay.js';
import { useCompletion } from './hooks/useCompletion.js';
import { SuggestionsDisplay } from './components/SuggestionsDisplay.js';
import { isAtCommand } from './utils/commandUtils.js';
import { isAtCommand, isSlashCommand } from './utils/commandUtils.js';
interface AppProps {
config: Config;
@@ -96,7 +96,8 @@ export const App = ({ config, settings, cliVersion }: AppProps) => {
const completion = useCompletion(
query,
config.getTargetDir(),
isInputActive && isAtCommand(query),
isInputActive && (isAtCommand(query) || isSlashCommand(query)),
slashCommands,
);
// --- Render Logic ---