DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

Extract to procedure: local variable is not removed from original parenting function #92

Closed lvanvugt closed 3 years ago

lvanvugt commented 3 years ago

When extracting a function it nicely includes local variables from its original parenting function in the newly created procedure. But unfortunately it leaves it declaration behind if it's no longer used there.

Can this be fixed?

DavidFeldhoff commented 3 years ago

Hi Luc, thanks for participating. It's currently by design if you want to use them afterwards. Abs I didn't want to pop up each time a message. But I'll think about what can be done or if a setting will make sense. And I have to find time because I'm currently working on another awesome project called ATDD. Maybe you've heard of it ;)

lvanvugt commented 3 years ago

Makes sense in one way. The other is: you might end up cleaning up a lot afterwards any way. I rather would have it cleaned up and thus forcing me to consciously have to add it again "if you want to use them afterwards". But yeah, I seems I'll have to wait till that other project gets done. 8-) ;-)

DavidFeldhoff commented 3 years ago

I decided to remove the local ones as well. For adding variables again there is the AL Navigator Extension, so I think your suggestion is the better one ;) I'll release it in a few days

DavidFeldhoff commented 3 years ago

In the last version it's released. Feel free to test and close it afterwards :)

lvanvugt commented 3 years ago

How long does it take before it's on the Gallery?

DavidFeldhoff commented 3 years ago

Just a few minutes. Here you can already see it (v0.2.20) https://marketplace.visualstudio.com/items?itemName=davidfeldhoff.al-codeactions Hope you can wait another 5 minutes :)

lvanvugt commented 3 years ago

Tested and OK.