Skip to content

Commit d6af322

Browse files
committed
Add comment
1 parent 3df8bc6 commit d6af322

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,10 @@ namespace ts {
11741174

11751175
const children = n.getChildren(sourceFile);
11761176
const i = binarySearchKey(children, position, (_, i) => i, (middle, _) => {
1177+
// This last callback is more of a selector than a comparator -
1178+
// `EqualTo` causes the `middle` result to be returned
1179+
// `GreaterThan` causes recursion on the left of the middle
1180+
// `LessThan` causes recursion on the right of the middle
11771181
if (position < children[middle].end) {
11781182
// first element whose end position is greater than the input position
11791183
if (!children[middle - 1] || position >= children[middle - 1].end) {

0 commit comments

Comments
 (0)