Ruby LSP Rails is a Ruby LSP extension for extra Rails editor features, such as:
- Displaying an ActiveRecord model's database columns and types when hovering over it
- (More to come!)
To install, add the following line to your application's Gemfile:
group :development do
gem "ruby-lsp-rails"
end
- Start your Rails server
- Hover over an ActiveRecord model to see its details
This gem consists of two components that enable enhanced Rails functionality in the editor:
- A Rack middleware that automatically exposes APIs when Rails server is running
- A Ruby LSP extension that connects to the exposed APIs to fetch runtime information from the Rails server
This is why the Rails server needs to be running for features to work.
Note
There is no need to restart the Ruby LSP every time the Rails server is booted. If the server is shut down, the extra features will temporarily disappear and reappear once the server is running again.
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/ruby-lsp-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.