Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions src/services/fixJSDocsparams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import {
codeFixAll,
createCodeFixAction,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / lint

This import relatively references another project; did you mean to import from a local _namespace module?

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.

Check failure on line 5 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Cannot find module '../_namespaces/ts.codefix.js' or its corresponding type declarations.
import {
JSDocParameterTag,
textChanges,
Diagnostics,
SyntaxKind,
SourceFile,
createIdentifier,
Node,
} from "../_namespaces/ts.js";

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / lint

This import relatively references another project; did you mean to import from a local _namespace module?

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

Check failure on line 14 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Cannot find module '../_namespaces/ts.js' or its corresponding type declarations.

const fixId = "fixJSDocParam";
const errorCodes = [
Diagnostics.Rename_param_tag_name.code,
];

registerCodeFix({
errorCodes,
getCodeActions(context) {

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 23 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Parameter 'context' implicitly has an 'any' type.
const { sourceFile } = context;
const paramTag = findJSDocParamTag(sourceFile, context.span.start);
if (!paramTag) return;

const changes = textChanges.ChangeTracker.with(context, t => doRename(t, sourceFile, paramTag, context.newName));

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Parameter 't' implicitly has an 'any' type.

Check failure on line 28 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Parameter 't' implicitly has an 'any' type.
return [createCodeFixAction(fixId, changes, Diagnostics.Rename_param_tag_name, fixId)];
},
fixIds: [fixId],
getAllCodeActions(context) {

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Parameter 'context' implicitly has an 'any' type.

Check failure on line 32 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Parameter 'context' implicitly has an 'any' type.
return codeFixAll(context, errorCodes, (changes, err) => {

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Parameter 'err' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Parameter 'changes' implicitly has an 'any' type.

Check failure on line 33 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Parameter 'err' implicitly has an 'any' type.
const paramTag = findJSDocParamTag(err.file, err.start);
if (!paramTag) return;
doRename(changes, err.file, paramTag, context.newName);
});
},
});

function findJSDocParamTag(sourceFile: SourceFile, pos: number): JSDocParameterTag | undefined {
// Traverse the AST to find the relevant @param JSDoc tag
const token = getTokenAtPosition(sourceFile, pos);

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Cannot find name 'getTokenAtPosition'.

Check failure on line 43 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Cannot find name 'getTokenAtPosition'.
return token && findAncestor(token, isJSDocParameterTag);

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on macos-14

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on macos-14

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on ubuntu-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / smoke

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node lts/* on ubuntu-latest with --no-bundle

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on ubuntu-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on ubuntu-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on ubuntu-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / self-check

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on ubuntu-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on macos-14

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on macos-14

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 18 on windows-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / browser-integration

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 22 on windows-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 14 on windows-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 20 on windows-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / Test Node 16 on windows-latest

Cannot find name 'findAncestor'.

Check failure on line 44 in src/services/fixJSDocsparams.ts

View workflow job for this annotation

GitHub Actions / coverage

Cannot find name 'findAncestor'.
}

function doRename(changes: textChanges.ChangeTracker, sourceFile: SourceFile, paramTag: JSDocParameterTag, newName: string): void {
const paramName = paramTag.name;
changes.replaceNode(sourceFile, paramName, createIdentifier(newName));
}

function isJSDocParameterTag(node: Node): node is JSDocParameterTag {
return node.kind === SyntaxKind.JSDocParameterTag;
}
25 changes: 25 additions & 0 deletions tests/cases/fourslash/renameParamTagQuickFix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/// <reference path='fourslash.ts' />

// Test for JSDoc @param quick fix reformatting issue

// @Filename: /a.js
//// /**
//// *
//// * @param eks {string} the first param
//// * @param y {number} the second param
//// */
//// function foo(x, y) {
//// }

verify.codeFix({
description: "Rename '@param' tag name 'eks' to 'x'",
index: 0,
newFileContent:
`/**
*
* @param x {string} the first param
* @param y {number} the second param
*/
function foo(x, y) {
}`,
});
Loading