Shopify / ruby-lsp-rails

A Ruby LSP add-on for Rails
https://shopify.github.io/ruby-lsp/rails-add-on
MIT License
579 stars 27 forks source link

Remove usage of `present?` from hover #509

Closed vinistock closed 2 weeks ago

vinistock commented 2 weeks ago

We cannot use present? in the add-on side of the code because that method is defined by activesupport and that gem is not required on the LSP side.

It's only safe to use it in the runtime server side. This is currently breaking hover.

Note: tests won't catch this because in tests the Rails context is loaded through the dummy application, which makes tests pass despite this code breaking every time in real scenarios.

vinistock commented 2 weeks ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @vinistock and the rest of your teammates on Graphite Graphite

vinistock commented 2 weeks ago

Merge activity

andyw8 commented 2 weeks ago

I'll try think of a way we could restructure the tests to catch this kind of thing.

https://github.com/Shopify/ruby-lsp-rails/pull/510