mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-26 21:05:54 -06:00
remove fix
* fixRemoveAbstractModifierInNonAbstractClass.ts
This commit is contained in:
parent
a94d955d9d
commit
43afb806de
@ -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);
|
||||
}));
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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 = <PropertyDeclaration>token.parent;
|
||||
const classDeclaration = <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 "
|
||||
}]
|
||||
}]
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -2,5 +2,4 @@
|
||||
/// <reference path="fixClassDoesntImplementInheritedAbstractMember.ts" />
|
||||
/// <reference path="fixClassSuperMustPrecedeThisAccess.ts" />
|
||||
/// <reference path="fixConstructorForDerivedNeedSuperCall.ts" />
|
||||
/// <reference path="fixExtendsInterfaceBecomesImplements.ts" />
|
||||
/// <reference path="fixRemoveAbstractModifierInNonAbstractClass.ts" />
|
||||
/// <reference path="fixExtendsInterfaceBecomesImplements.ts" />
|
||||
Loading…
x
Reference in New Issue
Block a user