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

Function offset

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

Source from the content-addressed store, hash-verified

2200 const lineStarts = [0];
2201 for (let i = safe.indexOf('\n'); i !== -1; i = safe.indexOf('\n', i + 1)) lineStarts.push(i + 1);
2202 const offset = (line: number, column: number): number => (lineStarts[line - 1] ?? safe.length) + column;
2203 const fns = context.getNodesInFile(file)
2204 .filter((n) => FN_KINDS.has(n.kind))
2205 .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