-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Arrow function body indentation affected by its type length #2736
Comments
I'd like to give this a shot. |
I've been combing over the code for a while now, and I think I understand what's going on. Mostly notes for myself: The variable declaration group is higher up in the IR tree than the type annotation group. When the tree gets flattened into biome/crates/biome_formatter/src/printer/mod.rs Lines 184 to 188 in 01c440d
I think one way to fix this is to introduce some kind of "break priority" field to the |
It seems that this approach assumes the current generated IR is accurate. Perhaps we could compare the IR generated by |
Ok yeah, I was looking at the IR before and it looked identical, but I'm looking at it again and it is definitely not. Biome is emitting an extra |
Environment information
Configuration
Playground link
https://biomejs.dev/playground/?lineWidth=90&code=YwBvAG4AcwB0ACAAVgBhAGwAdQBlAE0AZQBuAHUARABpAHYAaQBkAGUAcgA6ACAAUgBlAGEAYwB0AC4ARgBDADwAewAgAHYAYQBsAHUAZQA6ACAAcwB0AHIAaQBuAGcAIAB9ACAAJgAgAE8AbQBpAHQAPABNAGUAbgB1AEQAaQB2AGkAZABlAHIAUAByAG8AcABzACwAIAAnAHMAdgBhAGwAdQBlACcAPgA%2BACAAPQAgACgAewAgAHYAYQBsAHUAZQAgAH0AKQAgAD0APgAgAHsACgAgACAAcgBlAHQAdQByAG4AIAA8AE8AcgBpAGcAaQBuAGEAbABNAGUAbgB1AEQAaQB2AGkAZABlAHIAIAAvAD4AOwAKAH0AOwAKAAoACgAKAGMAbwBuAHMAdAAgAFYAYQBsAHUAZQBNAGUAbgB1AEQAaQB2AGkAZABlAHIAMgA6ACAAUgBlAGEAYwB0AC4ARgBDADwAewAgAHYAYQBsAHUAZQA6ACAAcwB0AHIAaQBuAGcAIAB9ACAAJgAgAE8AbQBpAHQAPABNAGUAbgB1AEQAaQB2AGkAZABlAHIAUAByAG8AcABzACwAIAAnAHMAdgBhAGwAdQBlACcALAAgACcAYQBuAG8AdABoAGUAcgB2AGEAbAB1AGUAJwA%2BAD4AIAA9ACAAKAB7ACAAdgBhAGwAdQBlACAAfQApACAAPQA%2BACAAewAKACAAIAByAGUAdAB1AHIAbgAgADwATwByAGkAZwBpAG4AYQBsAE0AZQBuAHUARABpAHYAaQBkAGUAcgAgAC8APgA7AAoAfQA7AAoA
Code of Conduct
The text was updated successfully, but these errors were encountered: