I've download the latest Visual Studio Code and am trying to write some HTML code. For example, <div>, <a>, <p>
tags. However, there are no HTML suggestions in Visual Studio Code:
I've read this article and it says:
Visual Studio Code provides basic support for HTML programming out of the box.
However, I've tried to install HTML extension:
In addition, I've turned on HTML5 suggestion in settings.json
file:
{
"workbench.colorTheme": "Visual Studio Light",
"workbench.activityBar.visible": true,
"editor.multiCursorModifier": "ctrlCmd",
"window.zoomLevel": 0,
"html.suggest.html5": true,
}
Nevertheless, HTML, CSS suggestion does not work.
What can I do to code with suggestions?
I think the issue is that Visual Studio Code is not detecting the file type correctly. If you notice in these pictures, vscode has correctly detected that I am writing a html file by the icon <>
beside the file name and the language indicator in the bottom right of the screen.
The language indicator most likely says plain text
in your case. Click on it and a menu should appear at the top centre of the screen. Then try the following:
Auto Detect
. I think this will be the first option.Configure File Association for '.html'...
2 can also be accomplished by adding
"files.associations": { "*.html": "html" }
to your settings.
OR just add to settings.json (File -> Preferences -> Settings)
:
{
// Configure file associations to languages (e.g. "*.extension": "html"). These have
//precedence over the default associations of the languages installed.
"files.associations": { "*.html": "html" },
}