有没有办法让 Visual Studio Code 识别 EJS 文件中的 HTML 语法 [英] Is there a way to make Visual Studio Code recognize HTML syntax in EJS files
问题描述
我在 Mac 上使用 Visual Studio Code 来处理 Node.js 应用程序.
I am using Visual Studio Code on a Mac to work on Node.js applications.
有没有办法让 Visual Studio Code 将 EJS 文件识别为 HTML 标记?我在用户首选项中没有看到任何文件/方案关联.
Is there a way to make Visual Studio Code recognize EJS files as HTML markup? I didn't see any file / scheme association in user preferences.
推荐答案
实际上,您可以.
正如 Andre 指出的,现在您可以在工作区设置中执行此操作.转到 Visual Studio Code 设置:File >>首选项 >>用户设置
As Andre points out, now you can do this in the workspace 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 窗口底部的纯文本"选项卡,将其更改为 HTML
,截图如下:
Click on the 'Plain text' tab at the bottom of the VS Code window and change it to HTML
, screenshot below:
这篇关于有没有办法让 Visual Studio Code 识别 EJS 文件中的 HTML 语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!