DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

Extract procedure for duplicate code (request) #153

Open PeterBizz opened 1 year ago

PeterBizz commented 1 year ago

Often the extract procedure function is used to eliminate duplicate code.

What about the following ideas:

DavidFeldhoff commented 1 year ago

Hi Peter, I understand the requirements, but have to see what I can do for you. Currently I rarely find time to develop, so no promises, but I'll have it in mind next time I look into it.

DavidFeldhoff commented 1 year ago

What would be if after the first extraction a pop up would show up telling you that there are more occurences of exactly the same code and asks you if they should be replaced as well (Yes/No)? If no code could be found that is exactly the same, then of course the pop pu wouldn't show up.

PeterBizz commented 1 year ago

May be the other way around? If the extracted procedure would duplicate an existing procedure you could pop up a question if the existing procedure needs to be re-used? (so option 1) . This seems to be less work for you.

Otherwise your suggestion is ok