简体   繁体   English

VSCODE - 如何在rails html.erb文件中自动关闭ruby的html代码

[英]VSCODE - How to auto closing html code of ruby on rails html.erb file

I want to auto closing the html code in the html.erb file. 我想自动关闭html.erb文件中的html代码。
What should I do? 我该怎么办?


Added screenshots


在此输入图像描述

  1. Install the Ruby extension. 安装Ruby扩展。
  2. Add this to your user settings: 将其添加到您的用户设置:

     "emmet.includeLanguages": {"erb": "html"} 

Example with erb and ruby: erb和ruby的例子:

VSCode用户设置

You don't need to install any extension, just add this to you User settings.json file in VSCode at the end of the file, and it will work like a charm. 您不需要安装任何扩展,只需将其添加到文件末尾的VSCode中的User settings.json文件中,它就像魅力一样。

"emmet.showSuggestionsAsSnippets": true,
"emmet.includeLanguages": {"html.erb": "html", "erb": "html"}

More info about emmet suggestion ordering 有关emmet建议订购的更多信息

Install Auto Close Tag Extension 安装自动关闭标记扩展

html.erb file is included by default 默认情况下包含html.erb文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM