diff options
| author | Seth Troisi <[email protected]> | 2025-05-01 00:52:01 +0000 |
|---|---|---|
| committer | Seth Troisi <[email protected]> | 2025-05-02 20:58:53 +0000 |
| commit | cc838fad44057a42561215fe3daed2834e6e0442 (patch) | |
| tree | 584251fd75d2d039d3e811fdab3c9d69a2ab0e0f /packages/cli/src/ui/utils/commandUtils.ts | |
| parent | f237082c37a10db1bf9d7daddf039bf4e002ec61 (diff) | |
Add autocomplete for slash commands
Diffstat (limited to 'packages/cli/src/ui/utils/commandUtils.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/commandUtils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/cli/src/ui/utils/commandUtils.ts b/packages/cli/src/ui/utils/commandUtils.ts index 64046658..bcae7b6c 100644 --- a/packages/cli/src/ui/utils/commandUtils.ts +++ b/packages/cli/src/ui/utils/commandUtils.ts @@ -16,6 +16,15 @@ export const isAtCommand = (query: string): boolean => // Check if starts with @ OR has a space, then @, then a non-space character. query.startsWith('@') || /\s@\S/.test(query); +/** + * Checks if a query string potentially represents an '/' command. + * It triggers if the query starts with '/' + * + * @param query The input query string. + * @returns True if the query looks like an '/' command, false otherwise. + */ +export const isSlashCommand = (query: string): boolean => query.startsWith('/'); + const control_symbols: string[] = ['/', '@', '!', '?', '$']; /** * Returns the first word of query with optional leading slash, ampersand, bang. |
