Add comment

This commit is contained in:
Wesley Wigham
2020-10-07 12:27:43 -07:00
parent 3df8bc6a03
commit d6af322287

View File

@@ -1174,6 +1174,10 @@ namespace ts {
const children = n.getChildren(sourceFile);
const i = binarySearchKey(children, position, (_, i) => i, (middle, _) => {
// This last callback is more of a selector than a comparator -
// `EqualTo` causes the `middle` result to be returned
// `GreaterThan` causes recursion on the left of the middle
// `LessThan` causes recursion on the right of the middle
if (position < children[middle].end) {
// first element whose end position is greater than the input position
if (!children[middle - 1] || position >= children[middle - 1].end) {