Home > Development Tools > VSCode > What should I do if vscode cannot complete tags?

What should I do if vscode cannot complete tags?

藏色散人
Release: 2020-02-06 11:16:08
Original
4887 people have browsed it

What should I do if vscode cannot complete tags?

What should I do if vscode cannot complete the tag? Code completion for html tags such as divs in vscode

Use vscode to write js code. When you click tab at the beginning, the code will not be automatically completed. In fact, there are still a lot of inconveniences. I checked the information, listed the steps, and just followed this setup.

Related recommendations: vscode tutorial

1, install plug-in

What should I do if vscode cannot complete tags?

2, Configure files.associations object

What should I do if vscode cannot complete tags?

The page after opening is as follows:

What should I do if vscode cannot complete tags?

Find "files.associations" in the Comm Used list ": {}

What should I do if vscode cannot complete tags?

Click the edit button on the left and edit in the edit box on the right. It turns out to be

{
    "emmet.triggerExpansionOnTab": true
}
Copy after login

Add a line

{
    "emmet.triggerExpansionOnTab": true,
    "files.associations": {"*.js": "html"}
}
Copy after login

Similarly, make changes in Workspace settings

It turned out to be

{
    "workbench.editor.closeEmptyGroups": false,
    "emmet.triggerExpansionOnTab": true
}
Copy after login

Add a line

{
    "workbench.editor.closeEmptyGroups": false,
    "emmet.triggerExpansionOnTab": true,
    "files.associations": {"*.js": "html"}
}
Copy after login

After saving, go back to the js file, hit the

tag, and automatically fill it Complete, the code takes effect.

Tips: If the file you want to complete is not a js file, but another suffix, such as a .vue file, just add the file suffix to the end of the list.

For example:

{
    "emmet.triggerExpansionOnTab": true,
    "files.associations": {
        "*.js": "html",
        "*.vue": "html"
    }
}
Copy after login

Remember to add

to both settings

The above is the detailed content of What should I do if vscode cannot complete tags?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template