diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 78c71403736..d48caf6f36f 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();