Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode not auto completing HTML

I'm having trouble with my new installed Visual Studio Code on Windows 7. On Mac the editor automatically closes html tags but on my Win7 not. I assume there must be some option to turn it on but I can't find any.

I'm talking about when eg. writing <html the intelliSense pops up and you click enter, usually it automatically puts in the </html> mine's not working. (The IntelliSense pops up but when you select one of the options it doesn't auto close the tag: <h1> -> </h1>)

like image 818
Harvey3589661 Avatar asked Jun 07 '15 18:06

Harvey3589661


People also ask

Why is my autocomplete not working in VS Code?

Why is VS Code suggestions not working? If you're coding in JavaScript or TypeScript and finds that VSCode IntelliSense does work but does not behave properly, it's likely that you've selected the wrong language mode. TypeScript and JavaScript share the same language service, so you need to select the right language.

How do I turn on autocomplete in Visual Studio?

The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space . If necessary, you can always return to the Visual Studio's native's IntelliSense. To do so, select Visual Studio on the Environment | IntelliSense | General page of ReSharper options ( Alt+R, O ).


Video Answer


2 Answers

Type the tag name (without starting <) then press Tab

for example type div then press tab and VS will convert it to <div></div>

Or type the opening tag then press Tab twice

for example :

  1. type <div
  2. press Tab
  3. press Tab

it will add the closing tag

like image 134
Rabolf Avatar answered Sep 20 '22 05:09

Rabolf


I was experiencing the same problem, then i saw something on my bottom right of vs code.. instead of using HTML, i was using Django-HTML, so i changed the language to html, Boom everything is working fine again.see image

like image 30
Siphamandla Hero Ngwenya Avatar answered Sep 23 '22 05:09

Siphamandla Hero Ngwenya