MCPcopy Create free account
hub / github.com/tree-sitter/tree-sitter-javascript / clientRectForRange

Function clientRectForRange

examples/text-editor-component.js:4287–4292  ·  view source on GitHub ↗
(textNode, startIndex, endIndex)

Source from the content-addressed store, hash-verified

4285
4286let rangeForMeasurement
4287function clientRectForRange (textNode, startIndex, endIndex) {
4288 if (!rangeForMeasurement) rangeForMeasurement = document.createRange()
4289 rangeForMeasurement.setStart(textNode, startIndex)
4290 rangeForMeasurement.setEnd(textNode, endIndex)
4291 return rangeForMeasurement.getBoundingClientRect()
4292}
4293
4294function textDecorationsEqual (oldDecorations, newDecorations) {
4295 if (!oldDecorations && newDecorations) return false

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…