From 2e0c3908ea94e89204ecee6f1f7f852b5bfb538b Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 1 Jul 2015 14:59:07 -0700 Subject: [PATCH] Address code review --- src/services/services.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index c1c0aee33af..01500b23812 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3619,7 +3619,7 @@ namespace ts { function getSymbolKind(symbol: Symbol, location: Node): string { let flags = symbol.getFlags(); - if (flags & SymbolFlags.Class) return symbol.declarations[0].kind === SyntaxKind.ClassExpression ? + if (flags & SymbolFlags.Class) return getDeclarationOfKind(symbol, SyntaxKind.ClassExpression) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & SymbolFlags.Enum) return ScriptElementKind.enumElement; if (flags & SymbolFlags.TypeAlias) return ScriptElementKind.typeElement; @@ -3832,7 +3832,7 @@ namespace ts { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class - if (symbol.getName() === "__class") { + if (getDeclarationOfKind(symbol, SyntaxKind.ClassExpression)) { pushTypePart(ScriptElementKind.localClassElement); } else {