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
Contextual parsing of Rails controllers #565
base: main
Are you sure you want to change the base?
Conversation
36d0316
to
fadc07d
Compare
We already have a Ruby parser dependency, consider reusing it rather than adding another one. |
Prism is a standard ruby gem and is included by default from Ruby 3.3 and can be installed from Ruby 3.0. I will do this experiment in Prism and then I can rewrite it to use the old parser. When parsing controllers I would like to return a key or a fallback, e.g. if there is a relative key in a method name I would like the key with either the method name included or with just the controller namespace. class EventsController < ApplicationController
def show
t(".relative")
end
end Then I would like it to first check for |
a325228
to
1fb6f4b
Compare
I don't mind dropping support for older rubies, but does Prism support JRuby?
Absolute keys are resolved by calling i18n-tasks/lib/i18n/tasks/scanners/relative_keys.rb Lines 7 to 12 in 2a9a9e0
Sounds like the code calling i18n-tasks/lib/i18n/tasks/data.rb Lines 11 to 13 in 2a9a9e0
|
Looks like Prism on JRuby is still a work-in-progress: http://blog.jruby.org/2024/02/jruby-prism-parser |
6946055
to
305b747
Compare
+1 for Prism! The speed gains rubocop is getting from using it are 👀 |
I think this means that JRuby are working on replacing their parser with Prism, for their compilation. |
244bf22
to
5d7ae4e
Compare
5d7ae4e
to
2018d84
Compare
TODO: