How to Prevent Removal of partial modifier on type?
I'd like to prevent the removal of the 'partial' modifier during Full Code Cleanup without turning off the removal of the rest of the redundancies ReSharper finds. Is there a way to do this? Can it be done in .editorconfig? Can it be done at a project level?
Please sign in to leave a comment.
Hello Ray!
The only way is disabling corresponding inspections. This can be done using ReSharper | Options | Code Inspection | Inspection Severity.
There're also editorconfig properties for these inspections:
Thank you.
I tried both of the editorconfig properties mentioned. While they did stop the highlighting/squiggly underlining, they did not prevent removal of the partial keyword when doing a clean-up (Ctrl-Alt-F).
Is there a way to accomplish this?
Hello Ray,
Thank you for the reply.
Could you please try installing the latest ReSharper 2019.2 EAP build https://www.jetbrains.com/resharper/eap/ and check cleanup code issue is still reproduced.
Thank you.
I added the following to my .editorconfig:
resharper_partial_method_with_single_part_highlighting = do_not_show
resharper_partial_type_with_single_part_highlighting = do_not_show
The latest EAP release did *not* remove the partial keyword when doing a code cleanup.
I then reverted to 2019.1.3 and the partial keyword was removed when doing a code cleanup.
It looks like the EAP functions the way I was hoping for. Is this the way it should work?
Hello Ray,
Yes, actually the was a bug, that was fixed in ReSharper 2019.2.
Thank you
Well it clearly wasn't fixed because I'm still getting that issue in 2019.3.
This isn't a StyleCop/inspection issue, this is a cleanup issue. I'm not even getting a warning for it and yet it still gets removed.
Where is the option to stop this happening?