Add more testcases and simplify

This commit is contained in:
Paul van Brenk
2016-11-01 16:31:23 -07:00
parent d4b99d66e0
commit b59714ea7e
7 changed files with 54 additions and 66 deletions

View File

@@ -54,14 +54,6 @@ namespace ts.codefix {
}
}
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.PropertyDeclaration:
return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos);
case SyntaxKind.TypeParameter:
const typeParameters = (<DeclarationWithTypeParameters>token.parent.parent).typeParameters;
if (typeParameters.length === 1) {
@@ -105,6 +97,12 @@ namespace ts.codefix {
case SyntaxKind.EnumDeclaration:
return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos);
default:
if (isDeclarationName(token)) {
return createCodeFix("", token.parent.pos, token.parent.end - token.parent.pos);
}
break;
}
break;