codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.89k stars 356 forks source link

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

Open Dorus opened 2 years ago

Dorus commented 2 years ago

Environment

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

codecadwallader commented 2 years ago

Thanks for the suggestion.

farahjr commented 1 year ago

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?

codecadwallader commented 1 year ago

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. :)