mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix for unnecessary duplication of comment
This commit is contained in:
@@ -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[];
|
||||
|
||||
|
||||
+19
@@ -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;
|
||||
}`,
|
||||
});
|
||||
+17
@@ -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;
|
||||
}
|
||||
`,
|
||||
});
|
||||
Reference in New Issue
Block a user