You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the issue! This is indeed a difficult one to write a title for 🤣 I'll take a look at this soon-ish, right now I'm rewriting this library in TypeScript so formatting changes need to take a bit of a back seat, but hopefully that won't take too long.
@dangmai - No problem! I just wanted to let you know about the bug with no expectations beyond that. You are an excellent maintainer and THANK YOU for this library and the ongoing work you put into it.
As for Typescript, that is awesome! The only JavaScript I write these days is for Salesforce, but aside from that I am 100% sold on using TypeScript for everything because it is so amazing. 😍
Looking at this issue now, there's actually some complexity to it. Your expected output has .start() on the same level as the parent expression, which makes it difficult to understand that it's a child expression. I would actually rather go with how Prettier upstream (for JS) handles this kind of complexity, example here.
Basically, if there's only 1 method call, it's always attached directly to the parent expression with no line break, no matter how long it is. If there are more than 1, new lines with another level of indentation is added.
Going down this route will also make it less of a cognitive switch when looking at formatted JS code and formatted Apex code, because they will have the same formatting behavior.
Sorry for the cryptic title!
Everything is indented as if the
new
keyword does not exist.Input:
Actual output:
Additional example
Expected output:
Additional information (please fill this out):
"prettier-plugin-apex": "^1.10.0"
The text was updated successfully, but these errors were encountered: