Reputation: 51
I'm working on a project with multiple pages using VS code. I have a problem with EMMET extension not working only in one of them ( it's working in CSS and other HTML files that contain the same header )
My setting.json looks like this
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"*html": "html",
"javascript": "javascriptreact",
"typescript": "typescriptreact"
},
I checked my HTML file if doesn't contain any wrong syntax that prevents EMMET from working and reset the whole environment and it still occurs. I tried to check if someone had the same problem as me but couldn't find the answer other than adding properties in the settings.json file.
Upvotes: 1
Views: 3926
Reputation: 21
In my case, the problem was having some <code>
tags with R code, which include a lot of assignments with <-
, in my HTML file. Emmet was probably failing to parse the file due to these looking like tag openings. Replacing every instance of <
within <code>
tags with <
solved the problem.
Upvotes: 1
Reputation: 118
NOTE: This answer should be helpful for the user migrating from Windows to Linux.
Got the same error after switching to Ubuntu from Windows. In my case, the problem was with some settings that were for windows. I removed the lines with errors and emmet started working correctly.
Error line was
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
Try having a look at the settings of VS Code in JSON and you may find any error that can solve your problem.
Upvotes: 1
Reputation: 51
Okay problem solved, i took a really deep look at my code and in header section, above all styles, scripts and links I could use EMMET. The problem was "-->" in one of the links. (I was using several API's) and i missed it. Anyway if someone has similar problem to this try adding the code below to your settings.json file. It also allows you to use EMMET with React JSX and Typescript ^^
"emmet.triggerExpansionOnTab": true, "emmet.includeLanguages": { "*html": "html", "javascript": "javascriptreact", "typescript": "typescriptreact" },
Thread closed. Have a nice day ^^
Upvotes: 4