Change built-in HTML formatter from `prettyhtml` to `vscode-html-languageservice`
See original GitHub issueIn 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.
- It has only a few known bugs but the repo is not longer maintained so we can’t expect bugs to be fixed.
- It is not supported for Namespace Components.
vscode-html-languageservice
format result has been improved, much better than in the past in my experience.vscode-html-languageservice
is a built-in dependency of volar, so we don’t to add other dependencies for this change.- With
vscode-html-languageservice
volar can reuse vscode HTML format settings as much as possible. prettyhtml
depends onprettier
, andprettier
does not support on browser, so for Web IDE support I need to use solution other thanprettyhtml
.
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)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
HTML Programming with Visual Studio Code
To improve the formatting of your HTML source code, you can use the Format Document command Ctrl+Shift+I to format the entire file or...
Read more >Prettier not formatting HTML files in VS Code - Stack Overflow
Set the formatter in dropdown (esbenp.prettier-vscode) for prettier. this can change if you are using any other formatter. Share.
Read more >VS Code Extensions for HTML | CSS-Tricks
Let's look at some extensions for VS Code that make writing and editing HTML (and languages that are basically HTML with extra powers) ......
Read more >VS Code - You don't need a formatting ... - Rob O'Leary
You can use the built-in formatters for a number of languages. ... VS Code has builtin formatters for HTML, JavaScript, TypeScript, ...
Read more >awesome-vscode | A curated list of delightful VS Code ...
Runs before the save action so you can still have a PHP formatter. Format HTML in PHP. Composer · PHP Debug - XDebug...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@reslear The text edit range of
prettyhtml
return is the entire html text, while the text edit range ofvscode-html-languageservice
return is only the actual changed range. In theory, the performance of vscode apply text edits will be improved after switching tovscode-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.
Thanks! However that would be using
prettier-html
. I thought the point of this change was for us to usevscode-html-languageservice
instead? If possible I’d like to use what’s built in but be able to configure it like before.