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

Function describeFilesMissingSymbols

src/bin/codegraph.ts:1139–1157  ·  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

1137 * wrong, what to do, and naming up to three of the files.
1138 */
1139function describeFilesMissingSymbols(health: { needsReindex: string[]; parseErrors: string[] }): string[] {
1140 const dash = getGlyphs().dash;
1141 const lines: string[] = [];
1142 const reindex = health.needsReindex.length;
1143 if (reindex > 0) {
1144 lines.push(
1145 `${formatNumber(reindex)} ${reindex === 1 ? 'file is missing its' : 'files are missing their'} symbols ${dash} ` +
1146 `run "codegraph sync" to re-index ${reindex === 1 ? 'it' : 'them'}: ${samplePaths(health.needsReindex)}`
1147 );
1148 }
1149 const unparsed = health.parseErrors.length;
1150 if (unparsed > 0) {
1151 lines.push(
1152 `${formatNumber(unparsed)} ${unparsed === 1 ? 'file could not be parsed, so its symbols are' : 'files could not be parsed, so their symbols are'} ` +
1153 `missing: ${samplePaths(health.parseErrors)} ${dash} "codegraph files --json" shows the errors`
1154 );
1155 }
1156 return lines;
1157}
1158
1159/**
1160 * 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