Does VS Code have an auto-import function or hot key for Java?
I installed Java Extension Pack but I found that I need to import every library manually.
You can use VS Code to read, write, run, and debug Java source file(s) without creating a project. VS Code for Java supports two modes, lightweight and standard.
For organize imports inside a java file
press SHIFT+ ALT + O
The vscode has also the option of enable auto organize imports on save action
Open the settings.json file (Ctrl+Shift+P than type settings.json) and add this:
"editor.codeActionsOnSave": { "source.organizeImports": true },
when you save it will works :D
Kudos: https://www.youtube.com/watch?v=svCTgx6abFc
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