The formatting configurations that really should be available. #2
Replies: 9 comments 17 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Robert Sösemann in StackOverflow mentioned these in this StackOverflow post
|
Beta Was this translation helpful? Give feedback.
-
Personally I really miss a continuation indentation configuration option. |
Beta Was this translation helpful? Give feedback.
-
Normalizing keywords and semi-keywords.
Extending this to something like Annotations. Apex being case insensitive creates this mess. Both are functional but it is the kind of stuff that I really want a formatter to take care of for me, I always hate expressing the nit in code reviews and so I end up with mixed case because at the end of the day it doesn't really make a difference. I'd still like it to be consistent. SOQL keywords are some of the least consistent of the bunch. |
Beta Was this translation helpful? Give feedback.
-
Array typing should be a preference. Some organizations prefer Warning: keep in mind that |
Beta Was this translation helpful? Give feedback.
-
We use Prettier on everything, standard config is: This might not be popular, but I like that there are minimal options, the more you provide the more individual teams will want to 'tune' and the more variation we need to cope with. Prettier does not create the nicest looking code, but IMO its much better than having lots of variation and devs having to deal with code review comments about formatting. |
Beta Was this translation helpful? Give feedback.
-
I don't like Prettier, but that's what I've ended up using to keep it consistent across the team who use different editors. I actually thing that the built-in formatter of Illuminated Cloud with default options is the closest to my ideal behaviour. The standout things that I care about are:
Here's what we use with Prettier:
|
Beta Was this translation helpful? Give feedback.
-
Maybe already obvious but I thought I'd put it here for others to weigh in on. One big part of adoption for me will be knowing what settings to apply for this to produce the same formatted output as Prettier-Apex. I think it would be harder for me to convince an entire team to switch over right away. If I could benefit from using this tool instead of Prettier-Apex out of the gate on my personal machine without disrupting the project then I'd could (when it is production ready) switch over right away and not have to migrate co-workers, CI Pipelines, etc... all at the same time. This would lower the barrier for adoption a lot. Making it a drop-in replacement would appeal to me when making a case for others to switch and I could win many small battles instead of having to spend weeks or months prepping for a migration. Imagine if I controlled the CI server and all I did was switch in this binary (because I could run this on the entire codebase, then run Prettier in |
Beta Was this translation helpful? Give feedback.
-
I don't think this has come up yet but what about empty classes? My preference is empty blocks to end on the same line. Take the following
I would prefer it be formatted as
I have created a lot of custom exception classes and it bothers me every time the closing brace is on another line. Maybe there are really good reasons you're doing it (Prettier-Apex has the same behavior but it was explained as more of an implementation detail than a decision) Maybe a setting? Of course if you simply choose it as a behavior then you won't be able to format identical to Prettier-Apex, going back to the decisions and strategy portion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A discussion for Ideas, thoughts, opinions on what should be in the configuration list.
The result will be amended into the Settings file
Beta Was this translation helpful? Give feedback.
All reactions