Community
Participate
Working Groups
Build Identifier: M20120208-0800 Align fields in columns is great for lining up simple variables; however, it looks awful for variables that have class/interface implementations like BroadcastReciever. The class/interface body definition should not be indented by default, or a setting to allow this exception should be provided. When align fields in columns is off, the class/interface definition that appears on the next line is not indented. Here's an example: private static final String TAG = "MyTag"; private SharedPreferences preferences; private BroadcastReceiver myReciever = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) ... }; Would prefer it to look like: private static final String TAG = "MyTag"; private SharedPreferences preferences; private BroadcastReceiver myReciever = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) ... }; Reproducible: Always Steps to Reproduce: 1. Create code as above 2. Format Source 3. Observe
Have you tried editing the active formatter profile under Java > Code Style > Formatter ? The number of options there is enormous, so you should be able to create a profile fitting your needs.
(In reply to comment #1) > Have you tried editing the active formatter profile under Java > Code Style > > Formatter ? The number of options there is enormous, so you should be able > to create a profile fitting your needs. Yes, this issue concerns one of those options not working as one would expect.
I've had the same problem - my formatting style is also set to align fields in columns, which I'd love to keep for the most part, but it does cause the above problem when I assign a new anonymous version of an Action to a field. I noticed the formatter now has @formatter:off and @formatter:on tags, which may help in a pinch (and need to be enabled, first), however this isn't the best solution as I do want the anonymous class definition to be formatted - just not indented out to beyond the '='.
This bug title should be changed to: [formatter] Indentation: Align fields in columns" would format anonymous inner class/interface implementations incorrectly