Merge pull request #16664 from amcasey/TokenWorker

Short-circuit getTokenAtPositionWorker
This commit is contained in:
Andrew Casey
2017-06-22 10:44:47 -07:00
committed by GitHub

View File

@@ -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();