简体   繁体   中英

Code rearrangement in Intellij IDEA (Android studio) in alphabetic order and priority

I am trying to make my life easier and code more beautiful)
Intellij IDEA is great IDEA with great engine which is used as core in Android Studio .

I know about possibilities to arrange code, it has some predefined rules that can be changed.
So I have tried to add some my own rules in order to make rearrangement fit my requirements.
I have already tried to do this myself, but failed. Arrange Your Code Automatically
I need to have following rules with priorities, they are simple.
List according to priorities

  1. Simple Alphabetical order of methods (a,b,c)
  2. Than arrangement as default by access modifiers (public,protected,private)
  3. And maybe some other filters,for example return value

I would be very grateful for any help or config files example.

For rearranging code you can use plugin Rearranger

He allows to you specify settings

  • how you need to arrange code;
  • ordering methods by name & modificators

I use a style settings from google , it helps for reading documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM