La coloration syntaxique est incorrecte lorsque le composant précédent se ferme automatiquement. (Voir capture d'écran ci-dessous.)
Vous pouvez copier le code suivant dans un fichier *.svelte
pour voir :
<SelfClosingComponent/>
<div>stuff</div> <!-- highlight problem with opening tag -->
<div>stuff</div> <!-- no highlight problem -->
<SelfClosingComponent/>
<meta/> <!-- highlight problem -->
<SelfClosingComponent/>
<div/> <!-- highlight problem, but also not valid html, so...??? -->
<SelfClosingComponent/>
<!-- <Intro/> --> <!-- highlight problem -->
<!-- <Intro/> --> <!-- returns to normal after problem -->
<SelfClosingComponent></SelfClosingComponent>
<div>stuff</div> <!-- no highlight problem when component has ending tag -->
Comportement prévisible
Highlight devrait revenir à un comportement normal après des composants à fermeture automatique tels que <SelfClosingComponent/>
.
Capture d'écran
Système (veuillez compléter les informations suivantes) :
Potentiellement lié : https://github.com/sveltejs/language-tools/issues/299
Un exemple plus simple
<div/>
<div></div>
Cela ne se produit que s'il n'y a pas d'espace avant la partie de fermeture
Waouh ! Merci @dummdidumm !