Fix handling of default class

This commit is contained in:
Arthur Ozga committed 2016-11-14 15:43:24 -08:00
1 parent d8b359f67b
commit 6400d53394
3 files changed
+13 -3

No files matched your search

@@ -8,10 +8,11 @@ namespace ts.codefix {
const token = getTokenAtPosition(sourceFile, start);
const checker = context.program.getTypeChecker();
if (!(token.kind === SyntaxKind.Identifier && isClassLike(token.parent))) {
const classDecl = getAncestor(token, SyntaxKind.ClassDeclaration) as ClassDeclaration;
if (!(classDecl && isClassLike(classDecl))) {
return undefined;
}
const classDecl = <ClassDeclaration>token.parent;
const startPos: number = classDecl.members.pos;
const implementedTypeNodes = getClassImplementsHeritageClauseElements(classDecl);