language-tools
language-tools copied to clipboard
Formatter removes comments in specific contexts
Describe the bug
The following comments get deleted.
<p /* a > b , c */ ></p>
<br /* a > b , c */ />
Reproduction
Put the above code in a .svelte file and format the document using Prettier
Expected behaviour
Comments shouldn't disappear
System Info
- OS: Windows
- IDE: VSCode
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
This comes from prettier-plugin-svelte: comments in an opening tag without attributes are never attached, and a > inside a comment ends the tag-range scan too early. I opened a fix in sveltejs/prettier-plugin-svelte#551.