-
-
Notifications
You must be signed in to change notification settings - Fork 5
Description
As stated in the docs, the current formatter output is similar to what Prettier produces for JavaScript. Most of my dev work is in JavaScript, so this is both preferable and really familiar to me, personally.
However, GameMaker has historically required a lot of horizontality because its IDE lost (still loses?) context when moving to a new line. In particular, the IDE did not provide function argument support if you wanted to put an argument on a new line.
This means that our main programmer and our existing code strongly prefer more horizontality, and unless the context issue has been resolved in recent GameMaker IDE versions it also needs to be that way.
I know the whole point of an auto-formatter like this is to minimize formatting options, but at least for our use case the current options don't fit with the practicalities of GML. In particular:
- Our RHS expressions are pretty much always on one line, even when they're really long, to maximize IDE support in GameMaker. This is particularly true for function calls.
- Since GameMaker has historically required a lot of positional function arguments, a lot of our function calls look like
doSomething("hello",,,true,,[10]). Having the formatter insertundefineds in there makes things significantly harder to read
Because of the historical functionality of GameMaker, we'd probably want a formatter that wasn't print-width-based at all, but rather just had a set of consistent semantics rules. The rules would be similar to what happens with GOBO when the print width is exceeded, with some exceptions:
- Function calls are always formatted on a single line
- Absent function arguments are not replaced with
undefined
Would it make sense to have this sort of GameMaker-friendly option, or is that out of scope for what you intend with Gobo?