mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Add comment
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user