Consider this input:
/**
* @description Rename a function argument
* @command refakts rename "[function-argument.input.ts 6:22-6:30]" --to "newParam"
*/
function processData(oldParam: string, other: number): string {
const result = oldParam.toUpperCase();
return oldParam + result + other;
}
Problem
- When reading this, it's difficult to know what is being renamed.
- If we modify the input code, it's tedious to update the command line correctly.
Proposed solution
- Use special comment markers to indicate the selection range.
Example
/**
* @description Rename a function argument
* @command refakts rename "[function-argument.input.ts {{CURRENT_SELECTION}}]" --to "newParam"
*/
function processData(/*|*/oldParam/*|*/: string, other: number): string {
const result = oldParam.toUpperCase();
return oldParam + result + other;
}
Consider this input:
Problem
Proposed solution
Example