MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / warnChangedOnDisk

Function warnChangedOnDisk

src/bin/codegraph.ts:418–426  ·  view source on GitHub ↗

* Say which files of an answer changed on disk after they were last indexed * (#3260). A CLI answer comes straight from the index with no watcher behind * it, so the line numbers of an edited file can point at other code; `node` * and `explore` already flag such a file, and `callers`, `callees` a

(changed: string[], json: boolean | undefined)

Source from the content-addressed store, hash-verified

416 * as `changedOnDisk`.
417 */
418function warnChangedOnDisk(changed: string[], json: boolean | undefined): void {
419 if (changed.length === 0) return;
420 const named = changed.slice(0, 5).join(', ') + (changed.length > 5 ? ` and ${changed.length - 5} more` : '');
421 const message = changed.length === 1
422 ? `${named} changed on disk after it was last indexed, so line numbers from it may be off. Run "codegraph sync" to update the index.`
423 : `${changed.length} files changed on disk after they were last indexed (${named}), so line numbers from them may be off. Run "codegraph sync" to update the index.`;
424 if (json) console.error(`${chalk.yellow(getGlyphs().warn)} ${message}`);
425 else warn(message);
426}
427
428/** "not found" (+ optional did-you-mean) when no exact symbol matches. */
429function formatSymbolNotFound(symbol: string, fuzzyNames: string[]): string {

Callers 1

mainFunction · 0.85

Calls 4

getGlyphsFunction · 0.90
warnFunction · 0.70
errorMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected