From dbfdb96f3956419d0040399757a4d7e6cef6c299 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 10 Jun 2015 18:24:34 -0700 Subject: [PATCH] Add explanatory comment --- src/services/services.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/services.ts b/src/services/services.ts index eda3a255e43..255b1f80e5c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -6050,6 +6050,10 @@ module ts { if (node && textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) { if (node.kind === SyntaxKind.Identifier && !nodeIsMissing(node)) { let identifier = node; + + // Only bother calling into the typechecker if this is an identifier that + // could possibly resolve to a type name. This makes classification run + // in a third of the time it would normally take. if (typeNames[identifier.text]) { let symbol = typeChecker.getSymbolAtLocation(node); if (symbol) {