Shopify / ruby-lsp-rails

A Ruby LSP addon for Rails
https://shopify.github.io/ruby-lsp-rails/
MIT License
518 stars 21 forks source link

Add Definition support for routes #331

Closed andyw8 closed 2 months ago

andyw8 commented 2 months ago

This PR adds support for the Definition request for Rails routes. This allow jumping from names route, e.g. new_user_path, to the corresponding route declaration, e.g. in routes.rb.

The implementation is based on @tenderlove's prototype in https://github.com/tenderlove/refreshing, and uses the behaviour added by @luanzeba and others in https://github.com/rails/rails/pull/47877.

Notes:

TODO:

Testing

It's working well on Identity, (which doesn't use Sorbet) and Code DB (which does use Sorbet).

andyw8 commented 2 months ago

Still a few things to finalize but this is ready for a first round of feedback.

andyw8 commented 3 weeks ago

For Shopify folk: This now works in Core