Skip to content

Commit b3b6c3b

Browse files
QuantumplationAndy
authored and
Andy
committed
Pass sourceFile to getChildren in getTokenAtPositionWorker (#25505) (#25538)
For performance reasons, we should always pass sourceFile to getChildren if available.
1 parent e9e5ebe commit b3b6c3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/utilities.ts

+1-1
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)