当使用VS CODE 时,如果窗口中打开的文件无法识别HTML的话,可以使用以下方法添加要识别的文件类型

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
找到该文件并修改\Microsoft VS Code\resources\app\extensions\html\package.json<br>{
    "name": "html",
    "version": "0.1.0",
    "publisher": "vscode",
    "engines": { "vscode": "*" },
    "contributes": {
        "languages": [{
            "id": "html",
            "extensions": [ ".html", ".htm", ".shtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm",".ejs"],
            "aliases": [ "HTML", "htm", "html", "xhtml","ejs"],
            "mimetypes": ["text/html", "text/x-jshtm", "text/template", "text/ng-template"]
        }],
        "grammars": [{
            /* "language": "html", not yet enabled*/
            "scopeName": "text.html.basic",
            "path": "./syntaxes/HTML.plist"
        }]
    }
}

  修改完成后重启VS CODE

posted @   xmily  阅读(4166)  评论(1编辑  收藏  举报
点击右上角即可分享
微信分享提示