Open cantin opened 2 years ago
Neat, but does this approach provide the correct line numbers and support i18n-tasks-use
comments?
@cantin can you try to add tests similar to https://github.com/glebm/i18n-tasks/blob/main/spec/used_keys_erb_spec.rb which I added for the AST-scanner for ERB?
Neat, but does this approach provide the correct line numbers and support
i18n-tasks-use
comments?
Hey, @glebm, thanks for the reply. So far in my test the line numbers are correct because the compiled content contains exact same line breaks.
Unfortunately the i18n-task-use
comment is not. it got removed in the compiled content. I guess we need to extend the Haml::Compiler#compile_haml_comment
to retain the comment.
Hey @davidwessman ,thanks for the reply. Nice spec, I'll look into it.
The HAML provides a method to return the precompiled content which is literally Ruby code. We can use it with the Ruby AST scanner to parse the HAML templates.
Does it make sense to you? Is it good to merge in as a default HAML scanner? Or put it on the Wiki?