-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
smart-rename is missing some renames #118
Comments
|
you can update |
i dont care about the length, i just want to remove the rebindings rebindings should only be preserved if there is a collision with other identifiers |
@milahu I believe the length is being used as a method to figure what is a minified variable or not. If you have a better method of consistently determining that in an automated fashion; feel free to suggest it. -- I haven't thought about this too deeply, but perhaps if a variable is being destructured, and the key it is being destructured from doesn't clash with any existing variables, then use that key as the variable name (regardless of length) |
Rephrase the updated rule I mentioned: Only keep the destructured name when the variable's length is >= 4 to avoid removing non-minified variables. However, this may not be a good strategy for obfuscated input. Then, we can also consider simply ignoring the length. |
exactly |
The length limitation has been removed. |
Describe the bug
smart-rename is missing some renames
Input code
Reproduction
No response
Steps to reproduce
No response
Expected behavior
rename
aa
toid
Actual behavior
smart-rename preserves the rebinding from
id
toaa
but there is no reason, the identifier
id
is not takenso renaming
aa
toid
does not shadow an existingid
identifierThe text was updated successfully, but these errors were encountered: