MCPcopy Index your code
hub / github.com/prettier/prettier / nodeContainsCursor

Function nodeContainsCursor

src/main/get-cursor-node.js:22–23  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

20 const { cursorOffset, locStart, locEnd, getVisitorKeys } = options;
21
22 const nodeContainsCursor = (node) =>
23 locStart(node) <= cursorOffset && locEnd(node) >= cursorOffset;
24
25 let cursorNode = ast;
26 const nodesContainingCursor = [ast];

Callers

nothing calls this directly

Calls 2

locStartFunction · 0.50
locEndFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…