MCPcopy Index your code
hub / github.com/nodejs/node / getEnclosingTextRange

Function getEnclosingTextRange

test/fixtures/snapshot/typescript.js:161285–161289  ·  view source on GitHub ↗

* Produces a range that spans the entirety of nodes, given a selection * that might start/end in the middle of nodes. * * For example, when the user makes a selection like this * v---v * var someThing = foo + bar;

(targetRange, sourceFile)

Source from the content-addressed store, hash-verified

161283 * this returns ^-------^
161284 */
161285 function getEnclosingTextRange(targetRange, sourceFile) {
161286 return isReadonlyArray(targetRange.range)
161287 ? { pos: ts.first(targetRange.range).getStart(sourceFile), end: ts.last(targetRange.range).getEnd() }
161288 : targetRange.range;
161289 }
161290 var Usage;
161291 (function (Usage) {
161292 // value should be passed to extracted method

Callers 1

Calls 3

isReadonlyArrayFunction · 0.85
firstMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…