| 33 | } |
| 34 | |
| 35 | function source(part: SessionV1.FilePart) { |
| 36 | if (!part.source) return part.source |
| 37 | if (part.source.type === "symbol") { |
| 38 | return { |
| 39 | ...part.source, |
| 40 | path: redact("file-path", part.id, part.source.path), |
| 41 | name: redact("file-symbol", part.id, part.source.name), |
| 42 | text: span(part.id, part.source.text), |
| 43 | } |
| 44 | } |
| 45 | if (part.source.type === "resource") { |
| 46 | return { |
| 47 | ...part.source, |
| 48 | clientName: redact("file-client", part.id, part.source.clientName), |
| 49 | uri: redact("file-uri", part.id, part.source.uri), |
| 50 | text: span(part.id, part.source.text), |
| 51 | } |
| 52 | } |
| 53 | return { |
| 54 | ...part.source, |
| 55 | path: redact("file-path", part.id, part.source.path), |
| 56 | text: span(part.id, part.source.text), |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | function filepart(part: SessionV1.FilePart): SessionV1.FilePart { |
| 61 | return { |