From 3ac9ffa75ef3d954b42b8e34a5cb3974d63f5018 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 27 Oct 2016 16:33:33 -0700 Subject: [PATCH] Nerf Extends to implements For Now --- .../codefixes/fixExtendsInterfaceBecomesImplements.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts b/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts index ebe277eb41c..a354b608915 100644 --- a/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts +++ b/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts @@ -13,20 +13,22 @@ namespace ts.codefix { // If there is already an implements keyword, we currently have incorrect behavior. // For now, we suppress the quickfix altogether. - /* + // TODO: (arozga) Fix this. if(ts.forEach(children, child => child.kind === SyntaxKind.ImplementsKeyword)) { return undefined; } - */ ts.forEach(children, child => { if (child.kind === SyntaxKind.ExtendsKeyword) { - // TODO: (arozga) why is there a space before implements + // Note: child.pos points to the space *before* `extends`. textChanges.push({ newText: " implements", span: { start: child.pos, length: child.end - child.pos } }); } }); } + // TODO: (arozga) Get Separate messages for + // 1) Change extends to implements + // 2) Move interface to extends clause if (textChanges.length > 0) { return [{ description: getLocaleSpecificMessage(Diagnostics.Change_extends_to_implements),