Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Reformat Code and Rearrange Code in Jetbrains IDEs?

Tags:

These are options that can be found under the Code dropdown menu. Both of them seem to arrange the code in a similar manner.

like image 406
roferrlls Avatar asked Dec 25 '17 11:12

roferrlls


People also ask

What does IntelliJ rearrange code do?

You can configure the IDE to rearrange code elements in modified files automatically when your changes are saved. Press Ctrl+Alt+S to open the IDE settings and select Tools | Actions on Save. Enable the Rearrange code option.

What is reformat code in IntelliJ?

Reformat a code fragmentIn the editor, select a code fragment you want to reformat. Before reformatting, you can take a look at the code style settings that are applied to the selected code: press Alt+Enter and click Adjust code style settings. From the main menu, select Code | Reformat Code or press Ctrl+Alt+L .

What is code formatting?

Source Code Format means a form of computer program, or any portion thereof, written in a programming language employed by computer programmers that must be compiled or otherwise translated before it can be executed by a computer.

What is reformat code in PyCharm?

Reformat File dialog The dialog appears when you press Ctrl+Alt+Shift+L in the editor of the current file. If you choose Code | Reformat Code from the main menu or press Ctrl+Alt+L , PyCharm tries to reformat the source code of the specified scope automatically.


1 Answers

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.

like image 111
harshithdwivedi Avatar answered Oct 19 '22 07:10

harshithdwivedi