Is it possible to enable some option to fold or collapse groups of import statements in java code using vscode?
Are there any extensions that do this job?
Fold Recursively (Ctrl+K Ctrl+[) folds the innermost uncollapsed region at the cursor and all regions inside that region. Unfold Recursively (Ctrl+K Ctrl+]) unfolds the region at the cursor and all regions inside that region. Fold All (Ctrl+K Ctrl+0) folds all regions in the editor.
Ctrl + Shift + [ on Windows and Linux. ⌥ + ⌘ + [ on macOS.
Ctrl+K Ctrl+[ Fold (collapse) all subregions editor. Ctrl+K Ctrl+] Unfold (uncollapse) all subregions editor.
As an alternative, consider VSCode 1.59 (Juil. 2021), which includes:
Automatically Fold Imports
Use the setting
editor.foldingImportsByDefault
to have import statements automatically folded.The fold state is stored once a file has been opened once.
The feature works with TypeScript, JavaScript, Java, C# and C++ and with all language that have a folding range provider that annotates
import
statements withFoldingRangeKind.Imports
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With