visual-studio-code - 有没有办法让 Visual Studio Code 识别 EJS 文件中的 HTML 语法

标签 visual-studio-code

我在 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,屏幕截图如下:

enter image description here

关于visual-studio-code - 有没有办法让 Visual Studio Code 识别 EJS 文件中的 HTML 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30264197/

相关文章:

regex - VS Code 多行搜索和替换 HTML/XML 标签?

html - 如何在 VScode 中格式化 HTML 代码?

visual-studio-code - VSC 命令日志

visual-studio-code - 如何在VS Code中显示 'Zen Mode'中的终端?

gcc - 无法打开源文件 "begin_code.h"( "SDL2/SDL.h"的依赖项)

amazon-web-services - 您知道如何使用 Visual Studio Code 使 cfn-lint 功能正常吗?

node.js - VS Code 集成终端抛出 `Cannot find module` & `nvm is not compatible with the npm config "前缀”选项`

git - 部署 ASP.Net MVC .Net Core 应用程序时出现错误 MSB4025

gulp - 如何在 Visual Studio Code 中启用智能感知?

typescript - Visual Studio Code 中的自动导入仅在 TypeScript 中提供带有 Lerna 子包的绝对路径