language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Folding the script tag hides its closing tag

Open juancpgo opened this issue 3 years ago • 5 comments

When editing .svelte files, the script closing tag </script> gets hidden by VS Code when I fold it. Screen Shot 2021-07-28 at 12 42 23

It doesn't happen with any other html tag, and it doesn't happen if I switch the file extension to .html.

If I rename script to anything else, the closing tag shows up: Screen Shot 2021-07-28 at 12 57 20

Does anyone know why? Is there a solution?

juancpgo avatar Jul 28 '21 15:07 juancpgo

ps: My VS Code settings folding strategy is set to "indentation". But switching it to "auto" doesn't solve the problem.

juancpgo avatar Jul 28 '21 16:07 juancpgo

We have special treatment with the script and style tag so that it can be folded without indentation. I don't know if it's possible to show the end tag.

jasonlyu123 avatar Jul 30 '21 01:07 jasonlyu123

We have special treatment with the script and style tag so that it can be folded without indentation. I don't know if it's possible to show the end tag.

So that must be it, because I realize those other tags (style and template) also behave the same way.

Can I remove that special treatment? How do I do it? (I'd like them to behave as the others tags, I use indentation the same way)

juancpgo avatar Jul 30 '21 05:07 juancpgo

Unfortunately it's not possible to remove that special treatment (well, you could go into the folder where the extension is installed, find the JSON file and change it there, but that's not a viable workaround I guess). We are stuck in an either-or-situation here. If we remove the special handling for these three tags, #523 is broken again, which would be worse than living with the minor inconvenience that the folded tags don't show their end tag.

dummdidumm avatar Aug 16 '21 12:08 dummdidumm

well, you could go into the folder where the extension is installed, find the JSON file and change it there, but that's not a viable workaround I guess

That's what I ended up doing. I guess it would be ideal to give the user an option to decide between showing a closing tag or being able to collapse <style> tags that have style code that isn't indented. That assumes a user settings can update/change actually disable something in language-configuration.json...

quoid avatar Mar 12 '22 03:03 quoid