-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Ruby on Rails detection based on Rails individual gems #2096
Comments
We can detect it is a Rails app without the actionpack And not be a Rails app. See the Rails repository itself. Sinatra apps can also have those dependencies if they plan to mount any Rails engine. We should detect for the |
I think matching on |
Yes |
@louim feel free to open a PR for that, should be fairly straightforward. |
@andyw8 I'll have a look! |
Note: this PR started checking for It's better than the specific gems, but it's not the behaviour with |
This issue is being marked as stale because there was no activity in the last 2 months |
I have checked that this feature is not already implemented
Use case
Currently,
ruby-lsp
detects if a project uses Rails and will automatically bundle theruby-lsp-rails
gem.It would be useful if this detection was not only done for the
rails
gem, but also on a combination of sub gems commonly used to run Rails.Description
Having the the
ruby-lsp-rails
automatically bundled when a subset of gems are use to run Rails would be useful.Implementation
It is possible to run Rails without requiring the Rails gem directly. Here is one such example in Discourse.
The current detection:
ruby-lsp/lib/ruby_lsp/setup_bundler.rb
Lines 151 to 153 in 410d584
Could also check if a combination of gem is included in the gemfile and in this case also bundle
ruby-lsp-rails
. I think checking for:actionpack
activemodel
activerecord
activesupport
railties
Would be enough to ensure that the app is actually running Rails. The other gems included by the Rails gem are not strictly required to run Rails and will sometimes be absent:
actioncable
actionmailbox
actionmailer
actiontext
activejob
activestorage
The text was updated successfully, but these errors were encountered: