MCPcopy
hub / github.com/anomalyco/opencode / getCode

Function getCode

packages/app/src/pages/session/file-tabs.tsx:65–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63 const [code, setCode] = createSignal<HTMLElement[]>([])
64
65 const getCode = () => {
66 const el = scroll
67 if (!el) return []
68
69 const host = el.querySelector("diffs-container")
70 if (!(host instanceof HTMLElement)) return []
71
72 const root = host.shadowRoot
73 if (!root) return []
74
75 return Array.from(root.querySelectorAll("[data-code]")).filter(
76 (node): node is HTMLElement => node instanceof HTMLElement && node.clientWidth > 0,
77 )
78 }
79
80 const save = (next: ScrollPos) => {
81 pending = next

Callers 1

syncFunction · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected