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

Server crashes with "Request textDocument/formatting failed." #2077

Closed
Glaisher opened this issue Oct 30, 2022 · 14 comments
Closed

Server crashes with "Request textDocument/formatting failed." #2077

Glaisher opened this issue Oct 30, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@Glaisher
Copy link

Environment
WSL Ubuntu
Volar v1.0.9
VS Code v1.72.2

Whenever a vue file is saved, I am getting the following error.

Request textDocument/formatting failed.
Message: Request textDocument/formatting failed with message: Overlapping edit
Code: -32603

It does work when the vue language server is restarted, but only one edit goes through successfully after restart each time.

@Glaisher
Copy link
Author

[2022-10-30 19:35:32.839] [exthost] [error] [Vue.volar] provider FAILED
[2022-10-30 19:35:32.839] [exthost] [error] Error: Request textDocument/formatting failed with message: Overlapping edit
	at Ys (/home/acc/.vscode-server/extensions/vue.volar-1.0.9-linux-x64/dist/node/client.js:4:228)
	at Fn (/home/acc/.vscode-server/extensions/vue.volar-1.0.9-linux-x64/dist/node/client.js:3:6865)
	at Immediate.<anonymous> (/home/acc/.vscode-server/extensions/vue.volar-1.0.9-linux-x64/dist/node/client.js:3:6712)
	at processImmediate (node:internal/timers:466:21)

@tazyong
Copy link

tazyong commented Nov 2, 2022

I encountered the same problem. An error occurred when Volar v1.0.9 was formatting the code. It can only be normal if it is downgraded to v1.0.8.

image

@roblues
Copy link

roblues commented Nov 7, 2022

same.
when the problem is occurred. reopen vue file, it is work.

@xinde
Copy link

xinde commented Nov 8, 2022

same

3 similar comments
@baixjian
Copy link

baixjian commented Nov 9, 2022

same

@nxzz
Copy link

nxzz commented Nov 14, 2022

same

@helderjnpinto
Copy link

same

@wycats
Copy link

wycats commented Nov 18, 2022

This happened to me when I added a <style scoped> tag to an existing .vue file. When I reopened the file, the problem went away.

@johnsoncodehk
Copy link
Member

Can you reproduce this problem in https://github.com/johnsoncodehk/volar-starter?

@cesswhite
Copy link

I have the same problem, and closing and opening the same file does not work for me.

Captura de Pantalla 2022-11-29 a la(s) 09 06 35

Captura de Pantalla 2022-11-29 a la(s) 09 07 05

@johnsoncodehk
Copy link
Member

Please provide minimal reproduction code so that I can debug the problem.

@whidy
Copy link

whidy commented Dec 5, 2022

Please provide minimal reproduction code so that I can debug the problem.

I found this error and try to reproduce it.

clone the project: https://github.com/whidy/issues-with-vue3/tree/volar-formatting-failed-demo

maybe video would help: https://www.youtube.com/watch?v=BB92-GNgmmQ

plugins in the video all lastest update.

@johnsoncodehk johnsoncodehk added bug Something isn't working and removed need info labels Dec 5, 2022
@tjventurini
Copy link

Same here. It is driving me nuts 😭

@johnsoncodehk Not sure what causes the problem. So I can't tell you how to reproduce it. Is there anything out of the blue that you would look at and that I can provide? 🤞

@mileusna
Copy link

mileusna commented Dec 6, 2022

I had the same issue in some files. After I have removed some commented code it worked. It looks like something is confusing extension when there are some empty lines with tabs between comments.

I can't actually tell what it is, but when I removed this comment, or just removed empty lines between commented lines, or just tabs on this empty lines, it worked.

// computed(function () {
                                                  <-- there is a tab here
//     if (query.value === '') {
//         return values;
//     }

//     return values;

// })

I hope this will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests