codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Insert blank line between methods, but not between methods in an interface.

Open Dorus opened this issue 4 years ago • 1 comments

Environment

  • Visual Studio version: 2022 Pofessional
  • CodeMaid version: 12.0.300
  • Code language: C#

Description

Insert blank line between methods, but not between methods in an interface.

If i have 2 methods in a class, i like a blank line between them. However, when i declare an interface, i would prefer to keep them all without newlines.

public class Buzz {
  public void foo() {
    // do stuff
  }

  public void bar() {
    // do stuff
  }
}

and

public interface IBuzz {
  void foo();
  void bar();
}

I can get either situatoin with the Cleaning->Insert options, but not both.

image

Dorus avatar Jan 27 '22 16:01 Dorus

Thanks for the suggestion.

codecadwallader avatar Feb 06 '22 20:02 codecadwallader

Yesss!! I just downloaded and that was the first problem I could see while trying to use it. Now I'm wondering how difficulty it would be to implement this, I might give it a try, or is there some WIP for this? How to know?

farahjr avatar Nov 04 '22 13:11 farahjr

Thanks for being willing to contribute! If there was any WIP I would expect there to be a comment on this issue. I think to implement it would require:

  1. Adding a new configuration option (backing setting and XAML update to toggle).
  2. Extending the blank line padding logic to conditionally check that configuration option. I think it might end up being around here: https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/Logic/Cleaning/InsertBlankLinePaddingLogic.cs#L92

There's some information around developing CodeMaid available here: https://www.codemaid.net/contribute/

Any questions please let me know. :)

codecadwallader avatar Dec 11 '22 17:12 codecadwallader