From 43afb806de70177e6b018223eb3f99b5f0cd9e58 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 15 Nov 2016 12:49:38 -0800 Subject: [PATCH] remove fix * fixRemoveAbstractModifierInNonAbstractClass.ts --- Jakefile.js | 1 - src/harness/tsconfig.json | 1 - ...emoveAbstractModifierInNonAbstractClass.ts | 40 ------------------- src/services/codefixes/fixes.ts | 3 +- 4 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/services/codefixes/fixRemoveAbstractModifierInNonAbstractClass.ts diff --git a/Jakefile.js b/Jakefile.js index fdb064334c3..d6671aceb9c 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -174,7 +174,6 @@ var servicesSources = [ "codefixes/fixClassDoesntImplementInheritedAbstractMember.ts", "codefixes/fixClassSuperMustPrecedeThisAccess.ts", "codefixes/fixConstructorForDerivedNeedSuperCall.ts", - "codefixes/fixRemoveAbstractModifierInNonAbstractClass.ts" ].map(function (f) { return path.join(servicesDirectory, f); })); diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 1cb17e2a843..5c248dbdfc5 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -79,7 +79,6 @@ "../services/codefixes/fixConstructorForDerivedNeedSuperCall.ts", "../services/codefixes/fixes.ts", "../services/codefixes/fixExtendsInterfaceBecomesImplements.ts", - "../services/codefixes/fixRemoveAbstractModifierInNonAbstractClass.ts", "harness.ts", "sourceMapRecorder.ts", "harnessLanguageService.ts", diff --git a/src/services/codefixes/fixRemoveAbstractModifierInNonAbstractClass.ts b/src/services/codefixes/fixRemoveAbstractModifierInNonAbstractClass.ts deleted file mode 100644 index 93b1513b149..00000000000 --- a/src/services/codefixes/fixRemoveAbstractModifierInNonAbstractClass.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* @internal */ -namespace ts.codefix { - registerCodeFix({ - errorCodes: [Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class.code], - getCodeActions: (context: CodeFixContext) => { - const sourceFile = context.sourceFile; - const start = context.span.start; - const token = getTokenAtPosition(sourceFile, start); - - Debug.assert(token.kind === SyntaxKind.AbstractKeyword); - - const propertyDeclaration = token.parent; - const classDeclaration = propertyDeclaration.parent; - const classKeywordStart = classDeclaration.getChildren()[0].getStart(); - - return [ - { - description: `Remove abstract modifier from ${propertyDeclaration.name.getText()}.`, - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: start, length: context.span.length + /*space*/ 1 }, - newText: "" - }] - }] - }, - { - description: `Make class ${classDeclaration.name.getText()} abstract.`, - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: classKeywordStart, length: 0 }, - newText: "abstract " - }] - }] - } - ]; - } - }); -} diff --git a/src/services/codefixes/fixes.ts b/src/services/codefixes/fixes.ts index 982b6abc84b..7df58b03f81 100644 --- a/src/services/codefixes/fixes.ts +++ b/src/services/codefixes/fixes.ts @@ -2,5 +2,4 @@ /// /// /// -/// -/// \ No newline at end of file +/// \ No newline at end of file