Indentation of component with the same name as an HTML element is incorrect #5279
Labels
good reproduction ✨
This issue provides a good reproduction, we will be able to investigate it first
🍰 p2-nice-to-have
Vue - Official extension or vue-tsc version
2.2.8
VSCode version
1.98.2
Vue version
3.5.x
TypeScript version
System Info
package.json dependencies
Steps to reproduce
What is expected?
When using a custom component (or any component with a closing tag?), the LSP formatter should always indent the children of that component.
What is actually happening?
I'm using InertiaJS to build my app. One of the components that ships with the library is
<Link></Link>
to facilitate single page routing. However, because that component has the same name as a native HTML element, I think it is getting caught by the formatter to not be indented, which makes sense because a native<link />
tag in the document<head>
is self closing.This is reproducible in the SFC playground.
https://play.vuejs.org/#eNp9UsFOwzAM/RWTS0GCVghO0E0CNAkQAgSTuOQyWq/LliZRko5JVf8dJ13HQGg32++5fq8vLbsxJl03yK5Y7gorjAeHvjEgZ6oaceYdZ2OuRG209dCCxTl0MLe6hoTWkh30JNRqO0+z0ISvJtdccVVo5TzUroJR2D9O7lFKDR/ayvIoOeEqz/rTdIgaj7WRM4/UAeSL83HbxuWuyzPq4lQo03hYn9W6REkyCecMsh4M1/uqFOvxdCEcuIVuZAmfCEKVqDyWaZ4FNNKiXirzbO82OyXzJH0uqnTptKI/1AY2Z4WujZBoX4wXZI2zK4hIwGbk7Osxzrxt8HSYFwssVv/Ml24TZpy9WnRo18jZDvMzW6Hv4cn7M26o3oHkvJHEPgC+odOyCRp72m2jSpK9x4tqH2KAQlVTN9l4VG4wFYQGZhf5nFGgdwes/8i9SC/jHlcd/cXhMfx9YuNDsQ/ZUOmk9kO028x+B9V9AwAz6wo=
Is this even fixable? I would "simply" rename the component, but since it comes from a library, I'm essentially making a wrapper/abstraction just to appease the formatter! 😓
Would it be possible to tell the formatter to always indent children if that tag has a closing tag?
Thanks!
Link to minimal reproduction
https://play.vuejs.org/#eNp9UsFOwzAM/RWTS0GCVghO0E0CNAkQAgSTuOQyWq/LliZRko5JVf8dJ13HQGg32++5fq8vLbsxJl03yK5Y7gorjAeHvjEgZ6oaceYdZ2OuRG209dCCxTl0MLe6hoTWkh30JNRqO0+z0ISvJtdccVVo5TzUroJR2D9O7lFKDR/ayvIoOeEqz/rTdIgaj7WRM4/UAeSL83HbxuWuyzPq4lQo03hYn9W6REkyCecMsh4M1/uqFOvxdCEcuIVuZAmfCEKVqDyWaZ4FNNKiXirzbO82OyXzJH0uqnTptKI/1AY2Z4WujZBoX4wXZI2zK4hIwGbk7Osxzrxt8HSYFwssVv/Ml24TZpy9WnRo18jZDvMzW6Hv4cn7M26o3oHkvJHEPgC+odOyCRp72m2jSpK9x4tqH2KAQlVTN9l4VG4wFYQGZhf5nFGgdwes/8i9SC/jHlcd/cXhMfx9YuNDsQ/ZUOmk9kO028x+B9V9AwAz6wo=
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: