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
With the current formatting, each element in the array would be wrapped onto its own line. With large element quantities, this can easily explode a unit's line count and degrade readability.
A proposed solution is to:
Using some heuristics, enter a "block" mode for elements. Suggestions include:
If all elements are integer literals
If all elements are shorter than a configured length
If the element count is over some threshold
Continue placing elements inline until over the line length, then break
Allow users to use // to break the line, as seen above (don't force 1-per-line like prettier though)
The text was updated successfully, but these errors were encountered:
const
ObjectReferenceVtable: array[0..2] of Pointer = (@NopQueryInterface, @RecAddRef, @TReference._Release_Obj);
InterfaceReferenceVtable: array[0..2] of Pointer = (@NopQueryInterface, @RecAddRef, @TReference._Release_Intf);
I get the opinionated part of the formatter but it should behave in a way where it allows different styles of some code structures to exist. If the code exists in one of the valid ways - fine, don't touch it. If it's not in a valid format then it can opt for one way to turn it into. I don't want a plethora of options to choose from to make the formatter produce some certain style but it should not only stick to one correct way and reformat another correct way. And the formatting of arrays or sets is one of them.
Especially since in this particular case I showed above just a few lines above there was a similar array with just 2 elements more and it left them in their own lines because it could not fit them all into one line. (well except the fact that it did eqyptian parentheses there which I absolutely loathe)
This is probably similar to the wrapping of parameters when the signature does not fit into one line. If I decide the "every parameter in its own line" style for all my methods the formatter will still touch that code and put all signatures into one line if they fit. And that's a bad behavior imo.
Continuing the discussion from #168.
Sometimes large quantities of arguments are a necessity. For example, a constant array construction:
With the current formatting, each element in the array would be wrapped onto its own line. With large element quantities, this can easily explode a unit's line count and degrade readability.
A proposed solution is to:
//
to break the line, as seen above (don't force 1-per-line like prettier though)The text was updated successfully, but these errors were encountered: