({
input,
inputMode,
hasSpeculationAccept,
}: {
input: string
inputMode: PromptInputMode
hasSpeculationAccept: boolean
})
| 87 | } |
| 88 | |
| 89 | function normalizeReplSubmitIntent({ |
| 90 | input, |
| 91 | inputMode, |
| 92 | hasSpeculationAccept, |
| 93 | }: { |
| 94 | input: string |
| 95 | inputMode: PromptInputMode |
| 96 | hasSpeculationAccept: boolean |
| 97 | }): NormalizedReplSubmitIntent { |
| 98 | if (hasSpeculationAccept) { |
| 99 | return { input, inputMode } |
| 100 | } |
| 101 | |
| 102 | if ((inputMode === 'prompt' || inputMode === 'bash') && input.startsWith('!')) { |
| 103 | return { |
| 104 | input: input.slice(1), |
| 105 | inputMode: 'bash', |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | return { input, inputMode } |
| 110 | } |
| 111 | |
| 112 | function findMatchingSubmitCommand( |
| 113 | input: string, |
no outgoing calls
no test coverage detected