diff --git a/src/services/utilities.ts b/src/services/utilities.ts index deccf19b8eae1..11c745a3e25b3 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.