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

Function selection

packages/app/src/utils/comment-note.ts:11–24  ·  view source on GitHub ↗
(selection: unknown)

Source from the content-addressed store, hash-verified

9}
10
11function selection(selection: unknown) {
12 if (!selection || typeof selection !== "object") return undefined
13 const startLine = Number((selection as FileSelection).startLine)
14 const startChar = Number((selection as FileSelection).startChar)
15 const endLine = Number((selection as FileSelection).endLine)
16 const endChar = Number((selection as FileSelection).endChar)
17 if (![startLine, startChar, endLine, endChar].every(Number.isFinite)) return undefined
18 return {
19 startLine,
20 startChar,
21 endLine,
22 endChar,
23 } satisfies FileSelection
24}
25
26export function createCommentMetadata(input: PromptComment) {
27 return {

Callers 4

readCommentMetadataFunction · 0.70
NewHomeFunction · 0.50
selectProjectFunction · 0.50
renderTimelineRowFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected