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

Inconsistent array comprehension wrapping #357

Closed
Gama11 opened this issue Feb 16, 2019 · 0 comments
Closed

Inconsistent array comprehension wrapping #357

Gama11 opened this issue Feb 16, 2019 · 0 comments
Labels
wrapping Incorrect or undesirable wrapping
Milestone

Comments

@Gama11
Copy link
Member

Gama11 commented Feb 16, 2019

Input file

class Main {
	function foo() {
		cmd = [
			for (a in [StringTools.replace(cmd, "/", "\\")].concat(args))
				StringTools.quoteWinArg(a, true)
		].join(" ");
	}
}

Broken output

class Main {
	function foo() {
		cmd = [
			for (a in [StringTools.replace(cmd, "/", "\\")].concat(args))
				StringTools.quoteWinArg(a, true)].join(" ");
	}
}

If the for loop has braces, it wraps nicely, but it shouldn't depend on that:

class Main {
	function foo() {
		cmd = [
			for (a in [StringTools.replace(cmd, "/", "\\")].concat(args)) {
				StringTools.quoteWinArg(a, true)
			}
		].join(" ");
	}
}
@Gama11 Gama11 added the wrapping Incorrect or undesirable wrapping label Feb 16, 2019
@Gama11 Gama11 added this to the haxe milestone Feb 16, 2019
AlexHaxe added a commit to AlexHaxe/haxe-formatter that referenced this issue Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrapping Incorrect or undesirable wrapping
Projects
None yet
Development

No branches or pull requests

1 participant