Skip to content

bdewater/ruby-lsp-rails

 
 

Repository files navigation

Ruby LSP Rails

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!)

Installation

To install, add the following line to your application's Gemfile:

group :development do
  gem "ruby-lsp-rails"
end

Usage

  1. Start your Rails server
  2. Hover over an ActiveRecord model to see its details

How It Works

This gem consists of two components that enable enhanced Rails functionality in the editor:

  1. A Rack middleware that automatically exposes APIs when Rails server is running
  2. 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.

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.

About

A Ruby LSP extension for Rails

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 87.3%
  • HTML 12.6%
  • CSS 0.1%