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

Function findElement

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

Source from the content-addressed store, hash-verified

2import { toRange } from "./selection-bridge"
3
4export function findElement(node: Node | null): HTMLElement | undefined {
5 if (!node) return
6 if (node instanceof HTMLElement) return node
7 return node.parentElement ?? undefined
8}
9
10export function findFileLineNumber(node: Node | null): number | undefined {
11 const el = findElement(node)

Callers 4

diffSelectionSideFunction · 0.90
findFileLineNumberFunction · 0.85
findDiffLineNumberFunction · 0.85
findCodeSelectionSideFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected