VSCode doesn't autocomplete HTML tags in React

Before updating VSCode to the latest version (1.14, I had 1.13), when I was working on my React projects, I could enter, for example, a div + TAB key and it was autocompleted. Also, if I typed div.row it automatically started it but now it doesn't work anymore. When I type in a div and press the TAB key, it is only line padding. I have the HTML snippets extension installed.

Anyone how I can get the autocomplete to work like it did before?

+3


source to share


1 answer


Visual Studio Code 1.14 introduced a new setting called emmet.useNewEmmet

, which defaults to true

.

If set true

, it will disable the setting by default emmet.triggerExpansionOnTab

.

Changing emmet.useNewEmmet

to false

will re-enable the tab extension.



However, since settings useNewEmmet

are the way forward, I recommend keeping useNewEmmet

as true

and instead adding two additional settings;

"emmet.includeLanguages": {
    "javascript": "javascriptreact"
    // any other languages you'd like
},
"emmet.showExpandedAbbreviation": "always"

      

Restarting VS Code after adding these two will force the editor to suggest the Emmet acronyms again and you will have the same behavior as before 1.14.

+9


source







All Articles