我在Mac上使用Visual Studio Code来处理Node.js应用程序。
有没有办法让Visual Studio代码将EJS文件识别为HTML标记?我在用户首选项中没有看到任何文件/方案关联。
发布于 2015-06-10 17:52:20
实际上,你可以的。
正如安德烈所指出的,现在您可以在工作区settings.Go to Visual Studio Code Settings:File >> Preferences >> User Settings
中执行此操作
// 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窗口底部的'Plain text‘选项卡,并将其更改为HTML
,屏幕截图如下:
发布于 2016-04-15 01:33:17
转到Visual Studio代码设置。>>文件>>首选项>>用户设置
在settings.json中添加此行。
// 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"}
}
重新启动Visual Studio代码。
发布于 2016-06-08 20:39:13
有一个支持.ejs的扩展。启动VS Code Quick Open (Ctrl+P),粘贴以下命令,然后键入enter。
ext install ejs-language-support
https://stackoverflow.com/questions/30264197
复制相似问题