| 54 | } |
| 55 | |
| 56 | export function formatCommentNote(input: { path: string; selection?: FileSelection; comment: string }) { |
| 57 | const start = input.selection ? Math.min(input.selection.startLine, input.selection.endLine) : undefined |
| 58 | const end = input.selection ? Math.max(input.selection.startLine, input.selection.endLine) : undefined |
| 59 | const range = |
| 60 | start === undefined || end === undefined |
| 61 | ? "this file" |
| 62 | : start === end |
| 63 | ? `line ${start}` |
| 64 | : `lines ${start} through ${end}` |
| 65 | return `The user made the following comment regarding ${range} of ${input.path}: ${input.comment}` |
| 66 | } |
| 67 | |
| 68 | export function parseCommentNote(text: string) { |
| 69 | const match = text.match( |