Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot disable auto formatting #2897

Closed
zlargon opened this issue Jan 24, 2023 · 5 comments
Closed

Cannot disable auto formatting #2897

zlargon opened this issue Jan 24, 2023 · 5 comments

Comments

@zlargon
Copy link

zlargon commented Jan 24, 2023

I want to turn off auto formatting when saving a file, as it takes too long (5 seconds). I've tried using the configuration java.format.enabled, but it's not working.

Environment
  • Operating System: macOS 13.1
  • JDK version: 11
  • Visual Studio Code version: 1.74.3
  • Java extension version: v1.14.0
Steps To Reproduce
  1. Add java.format.enabled: false in settings.json
  2. Edit java and save file
Current Result

The java file is formatted with java.format.enabled: false after file saved.

Expected Result

The java file should not be formatted with java.format.enabled: false after file saved.

Additional Informations

video screen recording:

java_plugin_format.mov
@fbricon
Copy link
Collaborator

fbricon commented Jan 24, 2023

Can you disable all other extensions, see if you still reproduce it?
Does your build file define some formatter plugin?

@zlargon
Copy link
Author

zlargon commented Jan 24, 2023

@fbricon I have disabled all other formatter plugins. It only stop formatting after I disable redhat.java.

@fbricon
Copy link
Collaborator

fbricon commented Feb 9, 2023

Something's fishy here. I can't reproduce it, When "java.format.enabled": false is set, you should no longer see the "Format Document" options when right-clicking on the file.

Are you sure your project doesn't contain a .vscode/settings.json that overrides your global formatter settings? Can you reproduce this behavior on a simple java project? Please provide some logs after setting "java.trace.server":"verbose" (execute command "Java: Open All Log Files")

Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

@ronyitc
Copy link

ronyitc commented Oct 17, 2024

I did everything but none worked. Now I am using Format: Save file without formatting from Command Menu using CMD + p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants