HaxeCheckstyle / haxe-formatter

Haxe code formatter based on tokentree
https://haxecheckstyle.github.io/haxe-formatter-docs/#codesamples.CommonSamples.allman_curlies
MIT License
72 stars 16 forks source link

Empty line added after metadata with function #307

Closed Gama11 closed 5 years ago

Gama11 commented 5 years ago

The formatter inserts an empty line after the @:jsonParse meta in this code example from tink_json:

@:jsonParse(function(json) return new Car(json.speed, json.make))
class Car {
    public var speed(default, null):Int;
    public var make(default, null):String;

    public function new(speed:Int, make:String) {
        this.speed = speed;
        this.make = make;
    }
}
gene-pavlovsky commented 5 years ago

For me this is still reproducible. The meta annotates the following line, arguably it doesn't make sense to add an empty line that introduces a separation between related things?

hxformat.json (partial)

    "emptyLines": {
        "betweenSingleLineTypes": 0,
        "betweenTypes": 1
    },
Gama11 commented 5 years ago

Can't reproduce this one either, even with the provided config. Are you sure you're using the correct / updated formatter version?

gene-pavlovsky commented 5 years ago

Yes, my bad, I wasn't using 1.5.1. It is fixed now indeed. Thanks guys