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

"beautify.onSave": false is overriden by "editor.formatOnSave": true #61

Closed
i-C-o-d-e-r opened this issue Oct 19, 2016 · 4 comments
Closed

Comments

@i-C-o-d-e-r
Copy link

Files are formatted even though "beautify.onSave" is false. This only happens, if "editor.formatOnSave" is true.

My propsal would be to activate beautify only and only if editor.formatOnSave is set to true. Change beautify.onSave so that setting it to true/false is not allowed, but only setting the file types is allowed:

Don't allow:
"beautify.onSave": true | false

Only allow:
"beautify.onSave": ["js","css"]

@HookyQR
Copy link
Owner

HookyQR commented Oct 19, 2016

Yep. This is caused by the changes mentioned in #59. I'll be implementing the formatOnSave to look at the onSave setting exactly has you've described.

@HookyQR
Copy link
Owner

HookyQR commented Oct 22, 2016

v0.5.0 ignores "beautify.onSave": true | false in favour of editor.formatOnSave. "beautify.onSave": [ ... ] is checked when formatOnSave is true.

@HookyQR HookyQR closed this as completed Oct 22, 2016
@i-C-o-d-e-r
Copy link
Author

@HookyQR just tried it and works well. Thanks!

Just a minor issue: When I update/install the beautify extension, then the file with the global default VS Code options/settings still contains

"beautify.onSave": false

which is not valid anymore.

Shall I create an issue for that?

@garygreen
Copy link

garygreen commented Feb 22, 2019

FYI - You can limit editor.formatOnSave to specific languages/extensions (this is a vs-code built in feature):

{
    "[less]": {
        "editor.formatOnSave": true
    }
}

This will only format .less files on save.

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

No branches or pull requests

3 participants