MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / offset

Function offset

src/resolution/frameworks/react.ts:2224–2224  ·  view source on GitHub ↗
(line: number, column: number)

Source from the content-addressed store, hash-verified

2222 const lineStarts = [0];
2223 for (let i = safe.indexOf('\n'); i !== -1; i = safe.indexOf('\n', i + 1)) lineStarts.push(i + 1);
2224 const offset = (line: number, column: number): number => (lineStarts[line - 1] ?? safe.length) + column;
2225 const fns = context.getNodesInFile(file)
2226 .filter((n) => FN_KINDS.has(n.kind))
2227 .map((n) => ({ start: offset(n.startLine, n.startColumn), end: offset(n.endLine, n.endColumn) }));

Callers 1

visibleAtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected