Open ByronBecker opened 1 year ago
This was originally the intended behavior, but I'll see if there's a way to support opt-in wrapping for generics (since this seems like a reasonable use case for it).
Since it might be a few weeks until I get around to this, just wanted to mention that you can deactivate the formatter for any declaration, expression, field, etc. using a // prettier-ignore
comment.
Motoko's lexer has some finicky rules for whitespace around type bindings. For example, a slight variation of the above code snippet results in a syntax error. My understanding is that this has something to do with disambiguating the "greater than" binary operator and the "close angle bracket" for type bindings, so it's rather deeply rooted in the language's syntax. I'll eventually do another pass on this (since it would be nice to have a way opt into the multi-line formatting), but the current approach seems to be the most consistent and reliable behavior given this parser limitation.
No problem Ryan - we actually just moved the comment to directly above the generics. You can label this as a super low priority issue.
Enjoy the holidays!
Sounds good. You as well!
becomes