Skip to content

Instantly share code, notes, and snippets.

@alexishida
Last active August 14, 2024 00:53
Show Gist options
  • Save alexishida/ca6c384f26f5958a42735b56d46dc9cd to your computer and use it in GitHub Desktop.
Save alexishida/ca6c384f26f5958a42735b56d46dc9cd to your computer and use it in GitHub Desktop.
vscode rails extensions
Extensions
Ruby
https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-extensions-pack
This plugin is highly recommended for its debugging capabilities and general Ruby support.
Rufo
https://marketplace.visualstudio.com/items?itemName=mbessey.vscode-rufo
Perfect for formatting your Ruby files (.rb). It’s a great alternative if you prefer not to use Rubocop.
ERB Formatter/Beautify
https://marketplace.visualstudio.com/items?itemName=aliariff.vscode-erb-beautify
Essential for formatting .html.erb files.
Simple Ruby ERB
https://marketplace.visualstudio.com/items?itemName=vortizhe.simple-ruby-erb
Provides syntax highlighting and other features for .html.erb files.
ERB Commenter (bonus)
https://marketplace.visualstudio.com/items?itemName=setobiralo.erb-commenter
Not mandatory, this plugin can significantly streamline your workflow. It allows the VSCode comment command to work as expected with .html.erb files, making it easier to comment out sections of your code.
Great! Now that we’ve installed all the necessary extensions and a few extras, let’s configure Visual Studio Code to recognize and properly format our ERB files.
To do this, we’ll need to make some changes to the settings.json file. Here’s what you’ll need to add:
Settings.json
"files.associations": {
"*.erb": "html",
"*.html.erb": "erb"
},
"[erb]": {
"editor.defaultFormatter": "aliariff.vscode-erb-beautify",
"editor.formatOnSave": true
}
Source:
https://blog.codeminer42.com/codetips9-readable-html-erb-files-on-vscode/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment