MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / startsWithPrefixAt

Function startsWithPrefixAt

packages/queryLanguage/src/tokens.ts:110–117  ·  view source on GitHub ↗

* Checks if the input at the given offset starts with a prefix keyword.

(input: InputStream, offset: number)

Source from the content-addressed store, hash-verified

108 * Checks if the input at the given offset starts with a prefix keyword.
109 */
110function startsWithPrefixAt(input: InputStream, offset: number): boolean {
111 for (const prefix of PREFIXES) {
112 if (matchesStringAt(input, offset, prefix)) {
113 return true;
114 }
115 }
116 return false;
117}
118
119/**
120 * Advances past whitespace starting at the given offset.

Callers 2

startsWithPrefixFunction · 0.85
isRegexQueryGroupingAtFunction · 0.85

Calls 1

matchesStringAtFunction · 0.85

Tested by

no test coverage detected