From Editor to IDE

Episode #266 by Teacher's Avatar David Kimura

Summary

Visual Studio Code is a powerful editor by itself, but with the addition of a few extensions, we can turn it into a much more intelligent IDE.
development environment 13:25

Resources

Summary

# Terminal
gem install solargraph
gem install ruby-debug-ide
gem install rubocop

# test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'

class ActiveSupport::TestCase
  # Run tests in parallel with specified workers
  parallelize(workers: 1)

  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
  fixtures :all

  # Add more helper methods to be used by all tests here...
end

# .vscode/launch.json
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Rails server",
      "type": "Ruby",
      "request": "launch",
      "program": "${workspaceRoot}/bin/rails",
      "args": [
        "server"
      ]
    }
  ]
}

# .rubocop.yml
Style/Documentation:
  Enabled: false
Style/FrozenStringLiteralComment:
  Enabled: false
Style/EmptyMethod:
  Enabled: false