ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Improve Rails app detection

Open andyw8 opened this issue 1 year ago • 2 comments

Motivation

Closes https://github.com/Shopify/ruby-lsp/issues/1466

Implementation

Check for the presence of bin/rails as suggested by Rafael.

Automated Tests

Included

Manual Tests

It's slightly awkward as we need to ensure the setup process doesn't end up installing the published version:

  • Check out this branch.
  • Temporarily change the version to something nonsense value, e.g. 0.14.999 so you can easily identify it.
  • Run gem build
  • Run gem install <filename>
  • Check out the rails/rails repo.
  • Delete the current .ruby-lsp directory if it exists
  • Reload the window
  • Ensure the Ruby LSP output window doesn't show a failure for bin/rails
  • Ensure .ruby-lsp/Gemfile doesn't contain ruby-lsp-rails
  • Remember to uninstall the temporary local gem afterwards, or it may result in confusing failures.

andyw8 avatar Mar 06 '24 19:03 andyw8

There is some corresponding discussion happening in https://github.com/Shopify/ruby-lsp-rails/pull/284 about what is the right approach for this.

andyw8 avatar Mar 08 '24 16:03 andyw8

My two cents is that, as long as the ruby-lsp-rails is not failing, we can delay this decision a little bit because we may find value in having the addon present for Ruby apps that have rails in the Gemfile, but aren't Rails applications.

vinistock avatar Mar 08 '24 18:03 vinistock

Handled by https://github.com/Shopify/ruby-lsp-rails/pull/284

andyw8 avatar Apr 04 '24 15:04 andyw8