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

Function describeFilesMissingSymbols

src/bin/codegraph.ts:1258–1276  ·  view source on GitHub ↗

* The `status` warnings for indexed files whose symbols are missing although * their content is current (#2335, #2336): one line per group, saying what is * wrong, what to do, and naming up to three of the files.

(health: { needsReindex: string[]; parseErrors: string[] })

Source from the content-addressed store, hash-verified

1256 * wrong, what to do, and naming up to three of the files.
1257 */
1258function describeFilesMissingSymbols(health: { needsReindex: string[]; parseErrors: string[] }): string[] {
1259 const dash = getGlyphs().dash;
1260 const lines: string[] = [];
1261 const reindex = health.needsReindex.length;
1262 if (reindex > 0) {
1263 lines.push(
1264 `${formatNumber(reindex)} ${reindex === 1 ? 'file is missing its' : 'files are missing their'} symbols ${dash} ` +
1265 `run "codegraph sync" to re-index ${reindex === 1 ? 'it' : 'them'}: ${samplePaths(health.needsReindex)}`
1266 );
1267 }
1268 const unparsed = health.parseErrors.length;
1269 if (unparsed > 0) {
1270 lines.push(
1271 `${formatNumber(unparsed)} ${unparsed === 1 ? 'file could not be parsed, so its symbols are' : 'files could not be parsed, so their symbols are'} ` +
1272 `missing: ${samplePaths(health.parseErrors)} ${dash} "codegraph files --json" shows the errors`
1273 );
1274 }
1275 return lines;
1276}
1277
1278/**
1279 * codegraph status [path]

Callers 1

mainFunction · 0.85

Calls 4

getGlyphsFunction · 0.90
samplePathsFunction · 0.85
pushMethod · 0.80
formatNumberFunction · 0.70

Tested by

no test coverage detected