Skip to content

Commit aac7fb7

Browse files
authored
Merge pull request #16664 from amcasey/TokenWorker
Short-circuit getTokenAtPositionWorker
2 parents f1fb1b9 + 2690d79 commit aac7fb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/utilities.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@ namespace ts {
649649

650650
const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, includeJsDocComment);
651651
if (start > position) {
652-
continue;
652+
// If this child begins after position, then all subsequent children will as well.
653+
break;
653654
}
654655

655656
const end = child.getEnd();

0 commit comments

Comments
 (0)