fix for unnecessary duplication of comment

This commit is contained in:
BigAru
2018-11-07 08:49:50 +01:00
parent 6b80047a05
commit 739e1e9786
3 changed files with 37 additions and 0 deletions
@@ -149,6 +149,7 @@ namespace ts.refactor.convertArrowFunctionOrFunctionExpression {
if (!variableInfo) return undefined;
const { variableDeclaration, variableDeclarationList, statement, name } = variableInfo;
suppressLeadingTrivia(statement);
const newNode = createFunctionDeclaration(func.decorators, statement.modifiers, func.asteriskToken, name, func.typeParameters, func.parameters, func.type, body);
let edits: FileTextChanges[];
@@ -0,0 +1,19 @@
/// <reference path='fourslash.ts' />
//// // Do not add me second time
//// export let foo = /*x*/a/*y*/ => {
//// let b = 1;
//// return a + b;
//// };
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert arrow function or function expression",
actionName: "Convert to named function",
actionDescription: "Convert to named function",
newContent: `// Do not add me second time
export function foo(a) {
let b = 1;
return a + b;
}`,
});
@@ -0,0 +1,17 @@
/// <reference path='fourslash.ts' />
//// // Do not add me second time
//// export let foo, bar = /*x*/(/*y*/) => 1 + 1;
goTo.select("x", "y");
edit.applyRefactor({
refactorName: "Convert arrow function or function expression",
actionName: "Convert to named function",
actionDescription: "Convert to named function",
newContent: `// Do not add me second time
export let foo;
export function bar() {
return 1 + 1;
}
`,
});