diff --git a/src/services/utilities.ts b/src/services/utilities.ts index c5483251c61..d74e829cf45 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -649,7 +649,8 @@ namespace ts { const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, includeJsDocComment); if (start > position) { - continue; + // If this child begins after position, then all subsequent children will as well. + break; } const end = child.getEnd();