-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Vetur auto formatting not working on .vue files until disabled and then re-enabled in preferences #2388
Comments
These steps may help us debug:
|
Although there's not enough information. |
Here is the output after adding
|
I'm the user mentioned also having this problem, but unfortunately toggling the setting isn't working for me. I'm currently having to run This problem started for me when I updated VS Code, the release notes indicate they have changed ESLint settings: https://code.visualstudio.com/updates/v1_50#_eslint |
Not sure if it is relevant |
Ref: microsoft/vscode#108447 (comment) If anyone can try add this config? "[vue]": {
"editor.defaultFormatter": "octref.vetur"
} It's supposed to solve the problem. |
Doesn't work for me |
@octref The v0.29.0 didn't solve this, I have the same error, how can I give you logs? |
@Nisgrak Open a new issue and follow https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md#how-to-create-a-repro-case |
I think it is a VSCode bug. |
|
This wasn't fixed correctly. The format of the |
The documentSelector is a list of DocumentFilter and can not contain a string as that is invalid per the LSP spec [1]. The types provided by https://github.com/microsoft/vscode-languageserver-node are wrong: microsoft/vscode-languageserver-node#685 It would be an option to send registrationOptions in proper format but it's not necessary to specify the documentSelector since vetur only runs in vue files. So skipping it entirely is equivalent. [1] https://microsoft.github.io/language-server-protocol/specification#documentFilter Resolves vuejs#2388
Per current version of the spec [1], the "documentSelector" is a list of DocumentFilter and can not contain a string. It seems like it was allowed to have a string in the past [2] but it's no longer the case and it doesn't work even in VSCode. [1] https://microsoft.github.io/language-server-protocol/specification#documentFilter [2] microsoft/vscode-languageserver-node#685 Resolves vuejs#2388
Per current version of the spec [1], the "documentSelector" is a list of DocumentFilter and can not contain a string. It seems like it was allowed to have a string in the past [2] but it's no longer the case and it doesn't work even in VSCode. [1] https://microsoft.github.io/language-server-protocol/specification#documentFilter [2] microsoft/vscode-languageserver-node#685 Resolves vuejs#2388
Settings -> Text Editor -> Formatting -> Check "Format on Save". |
Info
Problem
After launching VSCode, Vetur does not format .vue files until going into vscode preferences > extensions > vetur > toggle
Enable/Disable the Vetur document formatter
off and then on again. After toggling, it works as expected.Output from panel, both before and after toggling the mentioned setting so it appears Vetur is loaded when VSCode launches:
Reproducible Case
Unsure how I can reproduce this, but there is at least one other user on the Discord vueland eslint channel who has the same/similar problem.
The text was updated successfully, but these errors were encountered: