(cmd: string)
| 4 | export const looksLikeSlashCommand = (text: string) => /^\/[^\s/]*(?:\s|$)/.test(text) |
| 5 | |
| 6 | export const parseSlashCommand = (cmd: string) => { |
| 7 | const [name = '', ...rest] = cmd.slice(1).split(/\s+/) |
| 8 | |
| 9 | return { arg: rest.join(' '), cmd, name: name.toLowerCase() } |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * Apply a completion row to the current input, mirroring the editor's |