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

Change built-in HTML formatter from prettyhtml to vscode-html-languageservice #1078

Closed
johnsoncodehk opened this issue Mar 19, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@johnsoncodehk
Copy link
Member

In past I have chosen prettyhtml for Volar after comparing some HTML formatters, prettyhtml has always worked fine, but for some reasons I decided to replace the built-in HTML formatter with vscode-html-languageservice in 0.34.0.

prettyhtml will be migrated to an external plugin (#1027) and I will publish a package for it, for projects wishing to keep using prettyhtml, I will show how to do this. (Please keep an eye on the 0.34.0 changelog)

@johnsoncodehk johnsoncodehk added the enhancement New feature or request label Mar 19, 2022
@reslear
Copy link

reslear commented Mar 19, 2022

Good @johnsoncodehk thanks) How will the performance improve?

@johnsoncodehk
Copy link
Member Author

@reslear The text edit range of prettyhtmlreturn is the entire html text, while the text edit range of vscode-html-languageservicereturn is only the actual changed range. In theory, the performance of vscode apply text edits will be improved after switching to vscode-html-languageservice.

But since volar finally merges all text edits into one text edit of the entire vue text, it cannot take advantage of this, maybe it can be improved in the future.

@Dazaer
Copy link

Dazaer commented Apr 16, 2022

Huh, thought it was weird that all my stuff started formatting the wrong way!

Novice here. Any guides on how to configure this new change?

@johnsoncodehk
Copy link
Member Author

@Dazaer see #1174.

@Dazaer
Copy link

Dazaer commented Apr 16, 2022

@Dazaer see #1174.

Thanks! However that would be using prettier-html. I thought the point of this change was for us to use vscode-html-languageservice instead? If possible I'd like to use what's built in but be able to configure it like before.

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

No branches or pull requests

3 participants