You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript Version: 2.9.2 (also confirmed 3.0.0-dev.20180703)
Issue Type : Bug
Search Terms:
Refactor
Delete all unused Declarations
fixUnusedIdentifier
Code
When running the remove unused declarations refactor in VSCode it will remove unused parameters from any callbacks even when they are not the last position, which causes code to behave differently.
Actual Code after refactor
After running "Delete all unused Declarations" refactor on the unused import line ends up with:
letitems=["a","b","c"];items.map((i)=>i);
The refactor removed he "c" parameter, which changed the behaviour of the code.
Expected behaviour:
Expected the unused "c" parameter to be left alone (or replaced in "_", just not removed).
letitems=["a","b","c"];items.map((c,i)=>i);
Related Issues:
Something similar was mentioned in #24789 (comment)@Andy-MS seems to have done a change in #25011 related to that comment, but from what I can tell that seems to be for also removing the unused parameters from the function body instead.
The text was updated successfully, but these errors were encountered:
Doesn't reproduce for me with [email protected]. (Does reproduce with [email protected].) Are you sure your editor is set up to use the locally installed typescript?
Yes it seems that VSCode was still using v2.9.2.
I've tested this in a brand new project and confirmed that it's fixed in the latest daily build ([email protected]).
TypeScript Version: 2.9.2 (also confirmed 3.0.0-dev.20180703)
Issue Type : Bug
Search Terms:
Refactor
Delete all unused Declarations
fixUnusedIdentifier
Code
When running the remove unused declarations refactor in VSCode it will remove unused parameters from any callbacks even when they are not the last position, which causes code to behave differently.
Initial code
Actual Code after refactor
After running "Delete all unused Declarations" refactor on the unused import line ends up with:
The refactor removed he "c" parameter, which changed the behaviour of the code.
Expected behaviour:
Expected the unused "c" parameter to be left alone (or replaced in "_", just not removed).
Related Issues:
Something similar was mentioned in #24789 (comment) @Andy-MS seems to have done a change in #25011 related to that comment, but from what I can tell that seems to be for also removing the unused parameters from the function body instead.
The text was updated successfully, but these errors were encountered: