我在 Mac 上使用 Visual Studio Code 来处理 Node.js 应用程序。
有没有办法让 Visual Studio Code 将 EJS 文件识别为 HTML 标记?我在用户首选项中没有看到任何文件/方案关联。
最佳答案
事实上,你可以。
正如 Andre 指出的那样,现在您可以在工作区设置中执行此操作。转到 Visual Studio Code 设置:文件 >> 首选项 >> 用户设置
// Place your settings in this file to overwrite the default settings
{
// Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed.
"files.associations": {"*.ejs": "html"}
}
单击 VS Code 窗口底部的“纯文本”选项卡并将其更改为 HTML
,屏幕截图如下:
关于visual-studio-code - 有没有办法让 Visual Studio Code 识别 EJS 文件中的 HTML 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30264197/