In my VScode, on mac, when using the commentLine shortcut "command+/", in an html.erb file, instead of commenting out the line with an html <!-- comment -->
it wraps the highlighted code in a <% begin %>
<% end %>
block. How can I change the behaviour of VScode’s "editor.action.commentLine" function, which is what I believe this keyboard shortcut triggers, to insert the desired html comment tag?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
A solution that I found was to within VSCode's 'language-configuration-erb.json' file (path–'/Users/your_username/.vscode/extensions/bung87.rails-0.17.8/language-configuration-erb.json') make this change:
(mac–'command+shift+p', then type name to find the above file)
Select the text you want and press
ctrl+/
orcommand+/
You can define the following key binding:
Maybe you have to change the languageID:
erb