Skip to content

Commit afc5dd6

Browse files
Pass sourceFile to getChildren in getTokenAtPositionWorker (microsoft#25505)
For performance reasons, we should always pass sourceFile to getChildren if available.
1 parent 10b174a commit afc5dd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ namespace ts {
679679
let current: Node = sourceFile;
680680
outer: while (true) {
681681
// find the child that contains 'position'
682-
for (const child of current.getChildren()) {
682+
for (const child of current.getChildren(sourceFile)) {
683683
const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, /*includeJsDoc*/ true);
684684
if (start > position) {
685685
// If this child begins after position, then all subsequent children will as well.

0 commit comments

Comments
 (0)