Reputation: 121
VS code has suddenly stopped recognizing html files (the file icon is the default one for files with no extension)
all other file extensions work just fine
except for html
the tags still work but it won't autocomplete
Upvotes: 10
Views: 18635
Reputation: 1
There are some following step to set the problem:
"*html": "html"
Upvotes: 0
Reputation: 2266
Well if you have pyscript extension
installed, disable it. It has conflicts with html files I guess.
Or if you don't want to disable it just ctrl+shift+p
then change language mode
. Select configure file association for html.
This applies for any extension not just pyscript. For me it was pyscript
Upvotes: 0
Reputation: 1
So I just had this problem and I figured it out the problem was from an extension that I installed which is the pyscript extension I disabled it and everything started to work again!
Upvotes: 0
Reputation: 947
I had the same problem in Windows 10 a few minutes ago: Yeah, from the solutions above I did this but still had some errors:
File -- > Preferences --> Settings
In the search bar search for Files: Association.
In Files:Associations click on Add item button.
update Item = *.html & Value = HTML
As shown below:
When I saved, I got this error
Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.
The problem is that terminal.integrated.shellArgs settings have been deprecated.
One of the answers here will help:
Upvotes: 1
Reputation: 1638
Go to the settings (In mac it is Code -- > Preferences --> Settings)
Below is the screenshot for reference.
Upvotes: 6
Reputation: 1
I had the same issue but none of the other solutions worked for me!
You can try this:
Go to the path where the "settings.json" file exits, for my case the path is: C:> Users> User123 > AppData > Roaming > Code > User > settings.json
Now, paste the code in the file:
"code-runner.executorMap": {
"html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
}
Now search for the "files.associations"
section in your settings.json file:
As an example
Now if you have the "files.associations"
section then just add the line there:
"*html": "html"
(don't forget to write a comma after a line if there are more lines in it)
or if you don't have a "files.associations"
section, then copy paste the code there:
"files.associations": {
"*.rmd": "markdown",
"*html": "html"
},
Upvotes: 0
Reputation: 215
Adding this to file extensions worked for me:
"files.associations": {
"*.html": "html"
}
Upvotes: 21
Reputation: 61
In my case, for this problem the solution was to manually add *.html
to files.associations
, in user settings. Its unlogical but it seems that somehow the extension wasn't associated to the type of file. Now everything works perfectly...
Upvotes: 6