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:
Loaded bundled [email protected].
Vetur initialized
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.
These steps may help us debug:
"vetur.trace.server": "messages" config.Although there's not enough information.
But by reading the code, I think I can see what the problem is.
These steps may help us debug:
- Add
"vetur.trace.server": "messages"config.- Launching VSCode
- open a vue file in project.
- copy output from panel.
- paste message on it.
Here is the output after adding "vetur.trace.server": "messages" to the config.
[Trace - 1:59:25 PM] Sending request 'initialize - (0)'.
[Trace - 1:59:30 PM] Received notification 'window/logMessage'.
Loaded bundled [email protected].
[Trace - 1:59:30 PM] Received notification 'window/logMessage'.
Vetur initialized
[Trace - 1:59:30 PM] Received response 'initialize - (0)' in 4168ms.
[Trace - 1:59:30 PM] Sending notification 'initialized'.
[Trace - 1:59:30 PM] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 1:59:30 PM] Sending notification 'textDocument/didOpen'.
[Trace - 1:59:30 PM] Sending notification 'textDocument/didOpen'.
[Trace - 1:59:30 PM] Received request 'client/registerCapability - (0)'.
[Trace - 1:59:30 PM] Sending response 'client/registerCapability - (0)'. Processing request took 1ms
[Trace - 1:59:30 PM] Sending request 'textDocument/documentSymbol - (1)'.
[Trace - 1:59:30 PM] Sending request 'textDocument/documentLink - (2)'.
[Trace - 1:59:30 PM] Sending request 'textDocument/documentLink - (3)'.
[Trace - 1:59:30 PM] Sending request 'textDocument/documentColor - (4)'.
[Trace - 1:59:30 PM] Sending request 'textDocument/documentColor - (5)'.
[Trace - 1:59:32 PM] Sending notification '$/cancelRequest'.
[Trace - 1:59:32 PM] Sending request 'textDocument/documentSymbol - (6)'.
[Trace - 1:59:33 PM] Sending notification '$/cancelRequest'.
[Trace - 1:59:33 PM] Sending request 'textDocument/documentSymbol - (7)'.
[Trace - 1:59:34 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 1:59:34 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 1:59:35 PM] Received response 'textDocument/documentSymbol - (1)' in 4726ms.
[Trace - 1:59:35 PM] Received response 'textDocument/documentLink - (2)' in 4744ms.
[Trace - 1:59:35 PM] Received response 'textDocument/documentLink - (3)' in 4744ms.
[Trace - 1:59:35 PM] Received response 'textDocument/documentColor - (4)' in 4744ms.
[Trace - 1:59:35 PM] Received response 'textDocument/documentColor - (5)' in 4745ms.
[Trace - 1:59:35 PM] Received response 'textDocument/documentSymbol - (6)' in 2431ms.
[Trace - 1:59:35 PM] Received response 'textDocument/documentSymbol - (7)' in 1189ms.
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 npm run lint frequently...
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
https://github.com/microsoft/vscode/issues/108447
Ref: https://github.com/microsoft/vscode/issues/108447#issuecomment-712641584
If anyone can try add this config?
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
}
It's supposed to solve the problem.
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
@octref The v0.29.0 didn't solve this, I have the same error, how can I give you logs?
I think it is a VSCode bug.
https://github.com/microsoft/vscode/issues/108447
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
This wasn't fixed correctly. The format of the registerCapability message is invalid. I'll try to submit PR for this.