(
filePath: string,
covered: ReadonlyArray<ExploreLineRange>,
symbols: ReadonlyArray<string>,
opts: { partial: boolean },
)
| 217 | * "omitted", and it never steers to Read. |
| 218 | */ |
| 219 | export function formatBackReference( |
| 220 | filePath: string, |
| 221 | covered: ReadonlyArray<ExploreLineRange>, |
| 222 | symbols: ReadonlyArray<string>, |
| 223 | opts: { partial: boolean }, |
| 224 | ): string { |
| 225 | const names = symbols.slice(0, EXPLORE_DEDUP.MAX_SYMBOLS_IN_POINTER); |
| 226 | const moreNames = symbols.length - names.length; |
| 227 | const symbolPart = names.length > 0 |
| 228 | ? ` (${names.join(', ')}${moreNames > 0 ? `, +${moreNames} more` : ''})` |
| 229 | : ''; |
| 230 | const head = `> **Already sent earlier in this conversation:** \`${filePath}\` ${formatSpans(covered)}${symbolPart}`; |
| 231 | const tail = opts.partial |
| 232 | ? ' — unchanged on disk since, so that copy is still exact. Only the NEW lines are shown below; scroll back for the rest. Do NOT Read this file.' |
| 233 | : ' — unchanged on disk since, so that copy is still exact and is not repeated here. Use it from your context; do NOT Read this file.'; |
| 234 | return head + tail; |
| 235 | } |
| 236 | |
| 237 | /** Symbol names whose definitions fall inside the withheld spans. */ |
| 238 | export function symbolsInSpans( |
no test coverage detected