MCPcopy Create free account
hub / github.com/backnotprop/plannotator / buildRgArgs

Function buildRgArgs

packages/shared/code-nav.ts:163–187  ·  view source on GitHub ↗
(symbol: string, language?: string)

Source from the content-addressed store, hash-verified

161// ---------------------------------------------------------------------------
162
163export function buildRgArgs(symbol: string, language?: string): string[] {
164 const args: string[] = [
165 "--json",
166 "--line-number",
167 "--column",
168 "--max-count",
169 "50",
170 "--max-filesize",
171 "1M",
172 "--no-messages",
173 ];
174
175 for (const dir of CODE_NAV_IGNORED_GLOBS) {
176 args.push("--glob", `!${dir}`);
177 }
178
179 if (language) {
180 const rgType = RG_TYPE_MAP[language];
181 if (rgType) args.push("--type", rgType);
182 }
183
184 args.push("--word-regexp", "--", escapeRegex(symbol), ".");
185
186 return args;
187}
188
189// ---------------------------------------------------------------------------
190// rg JSON output parsing

Callers 2

code-nav.test.tsFile · 0.90
resolveCodeNavFunction · 0.85

Calls 2

escapeRegexFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected