Skip to content

Reformat code ​

ShortcutAction
Ctrl+Alt+LReformats the active file, or only the selected lines (Code › Reformat Code)
Ctrl+Alt+Shift+LOpens Reformat File: the whole file, the selected text, or only the text changed since the last commit (from the Git markers), with the Optimize imports option
Ctrl+Alt+OOnly optimizes the imports

The status bar says how many lines changed, or that the code was already well formatted. The new text comes in as small edits: the caret stays on the same code, and a single Ctrl+Z undoes it all.

By language ​

LanguageFormatter
Rustrustfmt, through rust-analyzer when it runs, otherwise directly, with the edition of the crate and the project's rustfmt.toml. The line endings of the file are kept.
JavaScript, TypeScriptThe formatter of tsserver (language server), with the indentation of the file. Optimizing the imports sorts them and removes the unused ones.
Javajdtls
JSONAtelier itself, with the indentation of the file and the order of the keys

Released under the MIT License.