These are options that can be found under the Code dropdown menu. Both of them seem to arrange the code in a similar manner.
What is the difference between Reformat Code and Rearrange Code in Jetbrains IDEs?
Asked Answered
There are 2 things that we might want to do after writing a piece of code:
- Order all the attributes in a certain way, like arrange them in ascending/descending order alphabetically.
- Remove the extra spaces/tabs that we might have given and arrange them in a proper indented format.
Rearrange code just does the 1st point, arranges it according to android code style guidelines. Reformat code does both 1st and 2nd point.
Rearranging code does more things than just reformat the code.
As mentioned in the docs, you can also change the placement of variables as well and define some custom rules which will be used when you rearrange the code.
© 2022 - 2024 — McMap. All rights reserved.