* 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[] })
| 1137 | * wrong, what to do, and naming up to three of the files. |
| 1138 | */ |
| 1139 | function 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] |
no test coverage detected