Code vertical alignment
Hi, i'm looking a way to simulate this xcode plugin (https://github.com/qfish/XAlign) functionality inside AppCode 3.0. Any Idea?
Please sign in to leave a comment.
Hi, i'm looking a way to simulate this xcode plugin (https://github.com/qfish/XAlign) functionality inside AppCode 3.0. Any Idea?
Please sign in to leave a comment.
Hi, Ignazio!
Could you provide the code fragment with the desired alignment?
There is a chance that you can reach the result by existing formatting options.
We are trying to support the most common formatting styles.
There are million options, we need to choose the limited set.
Regards,
-uta
This an example of code
and this is how it looks like after vertical alignment
Vertical alignemnt is widely used to link lines of code that are strog correlated, like when configure all the properties on one object.
Someone doesn't agree (like "clean-code man" Bob Martin) because with the vertical alignment you add an implict meaning behind the code, and everything that is not code should be maintained as the code. You must to take care of your vertical alignement as well of the comments on your code.
I got it!
Could you try the checked option "Variable groups|Align in columns" [x]?
That is in Settings|Code Style| C / C++/ Objective-C| Wrapping and Braces dialog.
You can find it fast by using "Find Action" option.
I have
or
depends on empty line presence.
Regards,
-uta
it works!
perfect thank you!
just a note: the behaviour of this function is quite different from the "x-align" xcode plugins.
Enabling this option all the variable are (automatically) aligned, even if are not correlated.
With the "x-align" plugin you can force a vertical alignment for small part of your code, but you loose all your vertical alignments if try to indent your code automaticcaly (and it's very bad).