Skip to content
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

Look up route from requirements #51850

Merged
merged 7 commits into from
May 23, 2024

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented May 17, 2024

Motivation / Background

For Ruby LSP Rails, we are looking to add a Code Lens for controller actions which displays the corresponding path:

Shopify/ruby-lsp-rails#241

It is working, but calls into RouteSet which is marked as private/internal.

Detail

This adds a small from_requirements method as part of the public API, that can be used by editor tooling to determine the route corresponding to a given requirements hash.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@andyw8 andyw8 changed the title Lookup route from requirements Look up route from requirements May 17, 2024
@rafaelfranca rafaelfranca merged commit a8fdfff into rails:main May 23, 2024
2 of 3 checks passed
rafaelfranca added a commit that referenced this pull request May 23, 2024
* Lookup route from requirements

* Add docs

* Strings instead of symbols

S

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <[email protected]>

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <[email protected]>

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <[email protected]>

* Update actionpack/lib/action_dispatch/routing/route_set.rb

Co-authored-by: Rafael Mendonça França <[email protected]>

---------

Co-authored-by: Andy Waite <[email protected]>
Co-authored-by: Rafael Mendonça França <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants