Not breaking line after last function argument
Can I make so that formatter won't break line after last argument in function signatures (in long lines)? If possible how would I define this in hxformat.json?
My current hxformat.json in this part looks like this
"functionSignature": {
"defaultWrap": "fillLine",
"defaultAdditionalIndent": 1,
"rules": [
{
"conditions": [
{
"cond": "lineLength >= n",
"value": 100
}
],
"type": "onePerLine",
"additionalIndent": 1
}
]
},
and I get functions formatted like this
function f(
a:String,
b:String,
c:String
) {
trace(a, b, c);
}
and I would like to get it like this
function f(
a:String,
b:String,
c:String) {
trace(a, b, c);
}
Thank a lot for you help and sorry if this is wrong place for asking questions.
BTW, can I find documentation about hxformat.json somewhere? At least reference of supported options and values would be good.
Hi, I transferred your issue over to formatter's issues.
right now there is no option to stop line breaks after last element in "onePerLine" mode
And there is also no real documentation on hxformat.json apart from a JSON schema that is integrated with VSCode that will help you by giving you autocompletion of options and values. It also shows tooltips for settings and their values.
There is a dump of a fully filled out hxformat.json at https://github.com/HaxeCheckstyle/haxe-formatter/blob/master/resources/default-hxformat.json (or you can create one with haxelib run formatter --default-config default-hxformat.json).
Hi Alex, Thank you for the explanation. Apologies for submitting issue to the wrong project.
no problem, luckily github has a transfer issue button :)