Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not breaking line after last function argument #518

Open
fed239 opened this issue Jun 28, 2019 · 4 comments
Open

Not breaking line after last function argument #518

fed239 opened this issue Jun 28, 2019 · 4 comments
Labels
enhancement New feature or request wrapping Incorrect or undesirable wrapping

Comments

@fed239
Copy link

fed239 commented Jun 28, 2019

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.

@fed239
Copy link
Author

fed239 commented Jun 28, 2019

BTW, can I find documentation about hxformat.json somewhere? At least reference of supported options and values would be good.

@AlexHaxe AlexHaxe transferred this issue from HaxeCheckstyle/haxe-checkstyle Jun 28, 2019
@AlexHaxe
Copy link
Member

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

@AlexHaxe AlexHaxe added enhancement New feature or request wrapping Incorrect or undesirable wrapping labels Jun 28, 2019
@fed239
Copy link
Author

fed239 commented Jun 28, 2019

Hi Alex, Thank you for the explanation. Apologies for submitting issue to the wrong project.

@AlexHaxe
Copy link
Member

no problem, luckily github has a transfer issue button :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wrapping Incorrect or undesirable wrapping
Projects
None yet
Development

No branches or pull requests

2 participants