The combination of "Code cleanup" and "Format document" removes to much if "remove unused code" is active.
In this video you can see it removing an event hook and the complete EASYTEST directive: https://www.screencast.com/t/TdFv9IoMQe
In the example the event declaration contains an not implemented exception, so it´s not unused. But it gets removed.
It also removes the EASYTEST directive above the event hook.
Under some circumstances it removes the inside code of directives: https://www.screencast.com/t/8nphdrztQnaD If I uncheck "Format document" in the cleanup options, no unexpected code is removed.
Hi Peter,
Thank you for the detailed explanation. I have reproduced the issue when the code is deleted and we are working on it.
I have also created a separate ticket about removing the event handler declaration containing the NotImplementedException:
The event handler containing the NotImplementedException should not be removed