VS Code default support code formatting and it track the syntactical error. If you create a new file and directly try to write the code than VS Code could not able to understand which language or type of syntax user want to format/correcting.
So, first need to save the new file with the proper extension than visual studio properly identify the syntax.
The code formatting is available in VS Code through the following shortcuts:
- On Windows Shift + Alt + F
- On Mac Shift + Option + F
- On Ubuntu Ctrl + Shift + I
You can add Auto Close Tag
from VS Code marketplace.
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text
ext install auto-close-tag
VS Code integration for HTMLHint - A Static Code Analysis Tool for HTML
ext install HTMLHint
Provides CSS class name completion for the HTML class attribute based on the CSS files in your workspace. Also supports React's className attribute.
ext install html-css-class-completion