From b3b6c3bdbcf6496931d5a5c272ea80bf33fc86eb Mon Sep 17 00:00:00 2001 From: Pi Lanningham Date: Mon, 9 Jul 2018 21:15:40 -0400 Subject: [PATCH] Pass sourceFile to getChildren in getTokenAtPositionWorker (#25505) (#25538) For performance reasons, we should always pass sourceFile to getChildren if available. --- src/services/utilities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index deccf19b8ea..11c745a3e25 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -679,7 +679,7 @@ namespace ts { let current: Node = sourceFile; outer: while (true) { // find the child that contains 'position' - for (const child of current.getChildren()) { + for (const child of current.getChildren(sourceFile)) { const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, /*includeJsDoc*/ true); if (start > position) { // If this child begins after position, then all subsequent children will as well.