haxe-formatter icon indicating copy to clipboard operation
haxe-formatter copied to clipboard

Allow line wrap after specific method modifiers

Open sebthom opened this issue 2 years ago • 1 comments

Describe the Feature
I would like to be able keep/place the inline and override modifiers for methods on separate lines

(Optional) Sample of desired output

class Foo extends Bar {

   override 
   public function getFrameworkName():String {
      return "foo";
   }

   inline
   public function doMagic():String {
      return "foo";
   }

}

sebthom avatar Jan 07 '23 11:01 sebthom

+1 to this. Right now I have functions like this

overload extern inline public static function rowifyObjects(x: Float, y: Float, rowDist: Float, obs: Array<Object>) {
   // ...
}

public static function printLocation(x: Float, y: Float) {
   // ...
}

overload extern inline public static function columnify(x: Float, y: Float, rowDist: Float, obs: Array<Object>) {
   // ...
}

If we could turn the above mess into something like this:

overload extern inline static 
public function rowifyObjects(x: Float, y: Float, rowDist: Float, obs: Array<Object>) {
   // ...
}

overload extern inline static 
public function columnify(x: Float, y: Float, rowDist: Float, obs: Array<Object>) {
   // ...
}

static 
public function printLocation(x: Float, y: Float) {
   // ...
}


Makes the code a lot neater I think.

distantforest1 avatar May 15 '24 08:05 distantforest1