MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / isNewCommandContext

Function isNewCommandContext

src/utils/bash/shellCompletion.ts:66–75  ·  view source on GitHub ↗

* 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,
)

Source from the content-addressed store, hash-verified

64 * (at start of input or after a command operator)
65 */
66function 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

Callers 1

parseInputContextFunction · 0.85

Calls 1

isCommandOperatorFunction · 0.85

Tested by

no test coverage detected