GoLand 2021.1 Help

Reformat Code on Directory dialog

Code | Reformat Code
Ctrl+Alt+L

This dialog appears when you select a Reformat Code action on the directory.

ItemDescription
Directory/ModuleThis is a read-only field that displays the name of the selected directory or module.
Options

This area displays options for your code reformatting.
You can select from the following options:

  • Include subdirectories select this checkbox to have source code from files in the nested directories reformatted. This checkbox only appears when the nested directories exist.

  • Optimize imports select this checkbox to remove unused import statements from the code within the selected scope.

  • Rearrange entries select this checkbox to reorder your source code entries.

  • Cleanup code select this option to run the code cleanup inspections.

  • Only VCS changed text if this checkbox is selected, then reformatting will apply only to the files that have been changed locally, but not yet checked in to the repository.

    This checkbox is only available for the files under version control.

Filters

This area displays options for the filters that you can apply to the code reformatting action.
You can select from the following options:

  • Scope select this checkbox to choose, from the list, a scope to which you want to apply your reformatting options. If you want to configure a custom scope, click the Browse button button to open the Scopes dialog.

  • File mask(s) select this checkbox to choose, from the list, file extensions to which you want to apply your reformatting options.

RunClick this button to start reformatting the source code within the specified scope.
Last modified: 22 April 2021