MCPcopy Create free account
hub / github.com/anomalyco/opencode / formatCommentNote

Function formatCommentNote

packages/app/src/utils/comment-note.ts:56–66  ·  view source on GitHub ↗
(input: { path: string; selection?: FileSelection; comment: string })

Source from the content-addressed store, hash-verified

54}
55
56export 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
68export function parseCommentNote(text: string) {
69 const match = text.match(

Callers 1

buildRequestPartsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected