-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Inline variable doesn't work with destructured variable declarations #25
Comments
Hi @noway 👋 Thank you for reporting this. Indeed, "Inline Variable" only works with Identifier for the moment. I didn't thought about destructured variables. Good one! I'll work on it to get it fixed asap. Note to myself, also need consider scenarios like: const { userId, playerId } = session;
messages.map(message => ({ userId })); If the selection is on const { playerId } = session;
messages.map(message => ({ userId: session.userId })); |
Hi there 👋 Let me give you some news on that:
So, it's on track, but it takes some time. Also, I will probably hold it for a moment because there are some refactorings / improvements I personally need to develop first. Finally, I reconsidered whether that was a bug or not. I came up with a more precise definition:
So don't be surprised: I changed the "bug" label for "improvement" in that sense. Technically, nothing is broken. But this scenario is not handled yet, and we'd like to handle it for sure 😃 When I'll be done with the essential refactorings that I need, my prioritization process will be: Bug > Improvement > New refactoring. Which means this one will be my next top-priority 😉 I hope that will give you a clearer vision on how I'm working backstage. I think this one will be done before October. |
Okay makes sense. BTW, just to mention, I would be fine with having to perform 2 operations: "Refactor destructured declaration to normal declaration" first and then "Inline variable". Although solving the issue on the core level is definitely better, you can build a workaround which just changes destructured declaration to a normal declaration as a step. Don't want to distract you from your current course of action of course. Maybe such a refactoring can be a separate refactoring. |
Hello @noway 👋 I've got good news: the pattern you reported is now supported 🎉 I'm not closing the issue yet as it still doesn't handle destructured array patterns (e.g. It will be shipped in the next release (v0.8.0), on Sunday 👍 |
@noway as I said, implementing the array pattern was easier now that the object pattern was implemented. It's now fully supported. The full support with array patterns will be shipped in the next release (probably on Sunday, I tend to release a new version every Sunday 😄). I hope that will be as helpful to you as it is to me. Thanks again for pushing it 👍 |
Describe the scenario
"Inline variable" refactoring doesn't work if the variable is declared via destructuring
How to reproduce
Expected behavior
Expecting Case 1. to work
Screenshots
Additional information
Thank you for this amazing project btw ❤️
Progression
The text was updated successfully, but these errors were encountered: