首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >有没有办法让Visual Studio代码识别EJS文件中的HTML语法

有没有办法让Visual Studio代码识别EJS文件中的HTML语法
EN

Stack Overflow用户
提问于 2015-05-16 00:15:05
回答 7查看 47.2K关注 0票数 69

我在Mac上使用Visual Studio Code来处理Node.js应用程序。

有没有办法让Visual Studio代码将EJS文件识别为HTML标记?我在用户首选项中没有看到任何文件/方案关联。

EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2015-06-10 17:52:20

实际上,你可以的。

正如安德烈所指出的,现在您可以在工作区settings.Go to Visual Studio Code Settings:File >> Preferences >> User Settings中执行此操作

代码语言:javascript
复制
// 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,屏幕截图如下:

票数 110
EN

Stack Overflow用户

发布于 2016-04-15 01:33:17

转到Visual Studio代码设置。>>文件>>首选项>>用户设置

在settings.json中添加此行。

代码语言:javascript
复制
// 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代码。

票数 64
EN

Stack Overflow用户

发布于 2016-06-08 20:39:13

有一个支持.ejs的扩展。启动VS Code Quick Open (Ctrl+P),粘贴以下命令,然后键入enter。

代码语言:javascript
复制
ext install ejs-language-support
票数 28
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30264197

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档