vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

How to turn off the automatic creation of class body when creating a new java file

Open xxc-zsz opened this issue 3 years ago • 5 comments

Create new file # VS Code supports applying templates when you create a Java source file. When you create a .java file in the File Explorer, the language server will automatically generate the class body, and fill the package info for you: video

I found this is the April 2020 update.

my question: Is there a way to turn off this feature? Or is it possible generate the main method at the same time as the class body is automatically generated?

xxc-zsz avatar Sep 01 '22 02:09 xxc-zsz

Could you share the reason why you want to turn it off?

jdneo avatar Sep 01 '22 05:09 jdneo

I have the same issue and want to turn this off. I want to write it manually

Kritiqual avatar Sep 15 '22 16:09 Kritiqual

I also want to be able to disable this, along with the automatic generation of package statements. Sometimes I want to make stand-along Java files to test something, such files don't need to be in a package.

JAK0723 avatar Mar 08 '23 10:03 JAK0723

Same here, I want to be able to modify the template for a class, enum... So that I can put it to be package private whenever I create a new one java file.

mamilic avatar Jan 17 '24 17:01 mamilic