-
Notifications
You must be signed in to change notification settings - Fork 6
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
How to Enable Local Formatting Configuration? #97
Comments
If you want to use "prettier", please install As a side note, e.g. coc-settings.json: {
// (1) Disable volar formatting.
"volar.formatting.enable": false,
// (2) Use a formatter when saving files.
"coc.preferences.formatOnSaveFiletypes": [
// ...snip
"vue"
],
// (3) Enable coc-prettier to use vue files as well
"prettier.disableLanguages": []
} |
Thanks for the information, @yaegassy! I was unaware that Prettier would ignore Vue files. I suppose Vetur was superseding Do you know whether it's possible to alter Volar's built-in formatting configuration as well? Does Volar handle formatting manually, or does it depend on other tools? |
I think Volar uses prettyhtml, prettier (probably in the css part), pug-beautify, sass-formatter, etc. internally. I don't think Volar's formatter allows you to change the detailed settings. With VSCode, it may be possible to adjust the ts/js part slightly, but not with coc-volar. Volar formatter is designed to be used out of the box, for more custom rules I recommend switching to Prettier ( |
Yes, that does seem the best way to go. I've just been spoiled by Vetur's I'll go ahead and close this issue. Thanks for your input! |
In my CoC config file, the
coc.preferences.formatOnSaveFiletypes
list containsvue
.volar.formatting.enable
set totrue
, the file is formatted on save, but the formatter ignores the local configuration for Prettiervolar.formatting.enable
set tofalse
, the file is not formatted on saveI recall that
coc-vetur
had thevetur.useWorkspaceDependencies
flag that respected local configurations. Is there something similar forcoc-volar
? Is there another CoC configuration option that should be used instead?I've noticed Volar has instructions for VS Code in this instance, but I don't know of an analog for Neovim.
The text was updated successfully, but these errors were encountered: