fix(52386): JSDoc code fixes for arrow-function initialized const duplicates comment (#52390)

This commit is contained in:
Oleksandr T
2023-01-25 09:42:57 +02:00
committed by GitHub
parent 7f64af2323
commit 43ecac801b
2 changed files with 21 additions and 2 deletions

View File

@@ -83,7 +83,7 @@ function getDeleteAction(context: CodeFixContext, { name, jsDocHost, jsDocParame
);
}
function getRenameAction(context: CodeFixContext, { name, signature, jsDocParameterTag }: Info) {
function getRenameAction(context: CodeFixContext, { name, jsDocHost, signature, jsDocParameterTag }: Info) {
if (!length(signature.parameters)) return undefined;
const sourceFile = context.sourceFile;
@@ -110,7 +110,7 @@ function getRenameAction(context: CodeFixContext, { name, signature, jsDocParame
jsDocParameterTag.comment
);
const changes = textChanges.ChangeTracker.with(context, changeTracker =>
changeTracker.replaceJSDocComment(sourceFile, signature, map(tags, t => t === jsDocParameterTag ? newJSDocParameterTag : t)));
changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, t => t === jsDocParameterTag ? newJSDocParameterTag : t)));
return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]);
}