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 {