* Check if we're in a context that expects a new command * (at start of input or after a command operator)
( tokens: ParseEntry[], currentTokenIndex: number, )
| 64 | * (at start of input or after a command operator) |
| 65 | */ |
| 66 | function isNewCommandContext( |
| 67 | tokens: ParseEntry[], |
| 68 | currentTokenIndex: number, |
| 69 | ): boolean { |
| 70 | if (currentTokenIndex === 0) { |
| 71 | return true |
| 72 | } |
| 73 | const prevToken = tokens[currentTokenIndex - 1] |
| 74 | return prevToken !== undefined && isCommandOperator(prevToken) |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Parse input to extract completion context |
no test coverage detected