Delphi: formatting uses lists to each unit is on a separate line
Posted by jpluimers on 2018/06/29
Delphi formatter setting, so I can manually arrange uses lists:
–jeroen
Also available in MMX Code Explorer in the settings dialog: Pascal -Sorting – Format unit uses clauses – “Each unit on a new line”.
If you prefer the standard setting and spare the other for special purpose, there is “Format Uses – Alternate” in the context menu. Perhaps give it a decent shortcut for quick access.
Bernd Ott in the same thread:
Important because scm. Less merge trouble. Only the last semicolon in last row is always stupid.
bascy said
It should move the comma’s to the start of each line and the closing semicolon to a separate line, that would mean even less merge trouble and make it much easier to comment out a line
jpluimers said
In my experience, that does not really matter: if you keep uses lists organised by topic (i.e. not append each new uses list entry at the end), then:
This is similar to SQL merge issues.
bascy said
True, it won’t eliminate all merge troubles, but as I’m more often changing or adding entries at the end than at the beginning, I think the chance on merge problems is smaller when using commas at the start of a line. The first entries are usually the “common” includes use don my places and they tend to be fairly static.
bascy said
[Edit] …The first entries are usually the “common” includes used on many places and they tend to be fairly static.