|
1 | 1 | # RailsRubyLsp
|
2 | 2 |
|
3 |
| -The RailsRubyLsp is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for extra Rails editor features. As long |
4 |
| -as this gem is a part of the project's bundle, the Ruby LSP will automatically load it to provide extra features. |
| 3 | +The RailsRubyLsp is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for extra Rails editor features, such as: |
5 | 4 |
|
6 |
| -## Usage |
7 |
| - |
8 |
| -This gem includes two elements that together allow for more Rails functionality in the editor. The first is a Rails |
9 |
| -engine that automatically exposes some APIs when running the Rails server in development mode. The second is a Ruby LSP |
10 |
| -extension that knows how to connect to the exposed APIs to fetch runtime information from the Rails server. |
11 |
| - |
12 |
| -In order to get the extra functionality in the editor, the Rails server must be running. |
| 5 | +- Displaying an ActiveRecord model's database columns and types when hovering over it |
| 6 | +- (More to come!) |
13 | 7 |
|
14 |
| -Note: the Ruby LSP does not need to be restarted every time the Rails server is booted. If you need to shutdown the |
15 |
| -server, the extra features will simply disappear and come back once the server is running again. |
16 | 8 |
|
17 | 9 | ## Installation
|
18 | 10 |
|
19 |
| -Add this line to your application's Gemfile: |
| 11 | +To install, add the following line to your application's Gemfile: |
20 | 12 |
|
21 | 13 | ```ruby
|
22 |
| -gem "rails_ruby_lsp" |
| 14 | +group :development do |
| 15 | + gem "rails_ruby_lsp" |
| 16 | +end |
23 | 17 | ```
|
24 | 18 |
|
| 19 | +## Usage |
| 20 | + |
| 21 | +1. Start your Rails server |
| 22 | +1. Hover over an ActiveRecord model to see its details |
| 23 | + |
| 24 | +## How It Works |
| 25 | + |
| 26 | +This gem consists of two components that enable enhanced Rails functionality in the editor: |
| 27 | + |
| 28 | +1. A Rails engine that automatically exposes APIs when Rails server is running |
| 29 | +1. A Ruby LSP extension that connects to the exposed APIs to fetch runtime information from the Rails server |
| 30 | + |
| 31 | +This is why the Rails server needs to be running for features to work. |
| 32 | + |
| 33 | +> **Note** |
| 34 | +> |
| 35 | +> There is no need to restart the Ruby LSP every time the Rails server is booted. |
| 36 | +> If the server is shut down, the extra features will temporarily disappear and reappear once the server is running again. |
| 37 | +
|
| 38 | + |
25 | 39 | ## Contributing
|
26 | 40 |
|
27 | 41 | Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/rails_ruby_lsp. This project is
|
|
0 commit comments