VS Code Annoying Auto Closing Tags Behavior

VS Code Annoying Auto Closing Tags Behavior

Dan Rodney

3 года назад

25,128 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@laceyhedger557
@laceyhedger557 - 16.01.2024 05:30

I found an extension that works. Well..... Works better than anything else I've tried. I installed the extension htmltagwrap. you select the line(s) of text, hit alt+w and it will automatically put the opening and closing tag. However, by default, it will use <p>. It can be changed, but I just now installed it, so I haven't gotten that far. BUT say I left the default, all you have to do is go into the opening tag and delete the p and type which tag you want and it will add it to the closing tag as well. To me, it is at least WAY less annoying.

Ответить
@user-gv9gj3hk3q
@user-gv9gj3hk3q - 20.11.2023 11:10

I only just started using vscode 2 months ago, and i only noticed this issue occur when i installed prettier extension in vscode, it was auto closing tags that dont need / like <br> and <hr> which is very annoying. i found there's the Setting in vscode called HTML: Auto Closing Tags, it solved the problem but i feel like prettier doesnt work anymore as in it doesnt indent the lines anymore.

Ответить
@Epinardscaramel
@Epinardscaramel - 20.09.2023 14:02

Yes! I find the auto-closing “feature” infuriating

Ответить
@williampetrosino4821
@williampetrosino4821 - 08.05.2023 03:12

Im sure you already knew this - but you can do ctrl + z and the closing tag will be deleted. You can add it at the end

Ответить
@iceman1982one
@iceman1982one - 27.04.2023 19:20

No solution , thanks , then my way is set with AHK keystroke for desire tag (F1 sendInput <div> )

Ответить
@machman23
@machman23 - 31.03.2023 23:31

Solution go into settings by holding control key and press comma key [ , ] Then type html and untick the box HTML: auto closing tabs. Then go to File on the Menu bar and select save. This seems to be working at present.

Ответить
@machman23
@machman23 - 31.03.2023 17:19

Thought I would try installing the auto close extension then disable its settings to off or taking the tick out of the box. This did not work. VS code still insists that if I type <p> then it generate a </p> right next to it when I dont want it to.

Ответить
@machman23
@machman23 - 31.03.2023 16:58

Can someone explain in plain English how to stop auto close of tags IE < or > I get this is frustrating and am frustrated myself. Where is the setting how do turn it off, where do I type True or False. As far as I can tell I have disabbled in both User settings and Workspace settings in vscode, but I still get the annoying auto closing of < and > where I dont want them and vs code trying to guess what closing tag it thinks I want to use. I have read through this thread and am still experienceing this auto closing of tags. Please someone in plain English can you explain and give an example not a ramble. Thank-you
PS Does VS code know about this issue?

Ответить
@Fasto09
@Fasto09 - 04.10.2022 22:33

Thank youu <3

Ответить
@StephenAinsworth1
@StephenAinsworth1 - 30.07.2022 18:13

When I close a html tag in a PHP file it ALWAYS pushes the close tag into the left (first character) so I could be a few tabs indented and it'll always return it far left as possible. It's super annoying and I don't know how to fix it!

Ответить
@dorvaan
@dorvaan - 10.05.2022 18:44

Did you ever come up with a solution for this? It's driving me nuts.

Ответить
@AlekNik1994
@AlekNik1994 - 10.05.2022 17:22

The solution is just open the parentheses and press TAB it will automatically close the tag, you don't have to type in the slash. After you opened the parentheses it automatically shows a suggestion of the tag you just opened.

This way you don't need 3 clicks, just 2 :)

Ответить
@edgarr_com
@edgarr_com - 27.03.2022 09:41

I love sublime shortcuts. That is the only reason I resist to move to VS Code...

Ответить
@WorstDeveloper
@WorstDeveloper - 07.02.2022 18:25

I hate that the end tag automatically completes when I type </, because sometimes it closes the wrong tag...

Ответить
@classyboy2000
@classyboy2000 - 01.02.2022 06:35

I completely agree with you. Did you open an issue on the the VS Code Github? Did you raise some hell (politely ask what's going on) on the VS Code Discoed server? Please let me know when you find a solution! :)

Ответить
@alisaadati8006
@alisaadati8006 - 19.01.2022 22:51

thank you

Ответить
@tmthyha
@tmthyha - 28.12.2021 22:50

honestly I would rather just manually type everything rather than the way they have it as default.

Ответить
@shaunbowen
@shaunbowen - 18.12.2021 23:11

Yes this behaviour in VS Code is intensely annoying. Why combine both behaviours into one setting? Surely the auto-creation of the closing tag negates the need for the </ shortcut in most cases? So put that as a separate option Microsoft!

Ответить
@jtjt8777
@jtjt8777 - 08.12.2021 15:09

VS Code added closing tag functionality. It is competing with Auto Close Tag extension. disable Vs Code's ..
"auto-close-tag.excludedTags": ["T", "t", "br", "any"],
"auto-close-tag.SublimeText3Mode": true,
"auto-close-tag.insertSpaceBeforeSelfClosingTag": true,
// "editor.autoClosingBrackets": "never",
"html.autoClosingTags": false,
"javascript.autoClosingTags": false,
"typescript.autoClosingTags": false,

Ответить
@torryk100
@torryk100 - 21.11.2021 13:26

It is not a built-in feature, but Auto Close Tag extension has auto-close-tag.SublimeText3Mode config parameter.

Ответить
@chelefranc
@chelefranc - 07.11.2021 08:03

Was there a solution to this problem. I hear you! I am a beginner and it is already annoying me. Thanks in advance for any comments!

Ответить
@K.Ray1
@K.Ray1 - 21.10.2021 08:20

Yes. I am experiencing a problem when I'm debugging. When I correct one tag, the body tag disappears. If I miss a ul tag, it gives a div tag. I haven't had a problem this frustrating until now. I will research and check back here. Thanks.

Ответить
@moya-gayehamilton1132
@moya-gayehamilton1132 - 09.09.2021 22:37

VS Code helps beginners like me to remember to close the tags. That's y I love it!

Ответить
@arifurrahmanrabbi
@arifurrahmanrabbi - 19.06.2021 10:39

I find this as a genuine problem and I don't know why people are not talking about this.

Ответить