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

Function findFileLineNumber

packages/session-ui/src/pierre/file-selection.ts:10–20  ·  view source on GitHub ↗
(node: Node | null)

Source from the content-addressed store, hash-verified

8}
9
10export function findFileLineNumber(node: Node | null): number | undefined {
11 const el = findElement(node)
12 if (!el) return
13
14 const line = el.closest("[data-line]")
15 if (!(line instanceof HTMLElement)) return
16
17 const value = parseInt(line.dataset.line ?? "", 10)
18 if (Number.isNaN(value)) return
19 return value
20}
21
22export function findDiffLineNumber(node: Node | null): number | undefined {
23 const el = findElement(node)

Callers

nothing calls this directly

Calls 1

findElementFunction · 0.85

Tested by

no test coverage detected