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

Unstable object literal wrapping #503

Open
Gama11 opened this issue Jun 12, 2019 · 0 comments
Open

Unstable object literal wrapping #503

Gama11 opened this issue Jun 12, 2019 · 0 comments
Labels
unstable output changes with multiple formatting passes wrapping Incorrect or undesirable wrapping

Comments

@Gama11
Copy link
Member

Gama11 commented Jun 12, 2019

The formatter needs two passes to get the right result here:

Input file

class Main {
    public static function main():Void {
        var b = {foo: doesFit("foo"), bar: doesFit("bar"), foobar: doesntFit("foo", "bar", 42)};
    }
}

After first formatting

class Main {
	public static function main():Void {
		var b = {foo: doesFit("foo"), bar: doesFit("bar"),
			foobar: doesntFit("foo", "bar", 42)};
	}
}

After second formatting

class Main {
	public static function main():Void {
		var b = {
			foo: doesFit("foo"),
			bar: doesFit("bar"),
			foobar: doesntFit("foo", "bar", 42)
		};
	}
}

Optional: hxformat.json

{
	"wrapping": {
		"maxLineLength": 80
	}
}
@Gama11 Gama11 added wrapping Incorrect or undesirable wrapping unstable output changes with multiple formatting passes labels Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unstable output changes with multiple formatting passes wrapping Incorrect or undesirable wrapping
Projects
None yet
Development

No branches or pull requests

1 participant