tmm1 / ripper-tags

fast, accurate ctags generator for ruby source code using Ripper
MIT License
550 stars 43 forks source link

Generate tags for methods defined in blocks #105

Closed tycooon closed 1 year ago

tycooon commented 4 years ago

As discussed here: https://github.com/tmm1/ripper-tags/issues/94#issuecomment-551546094

Now this code will generate tags:

some_cool_dsl_method do
  def my_method
    # ...
  end
end

Tested in some big projects, seems to work.

Update: also contains fix from #79 since basically it requires that change.

mislav commented 4 years ago

Thank you! I've amended the test to include some failing cases, could you look at that?

Basically, things like define_method and attr_accessor should not generate any tags if they are called with dynamic arguments (a variable or a string interpolated at runtime)

I've also brought in the actual commit from #79 to preserve attribution 💖

tycooon commented 4 years ago

Hmm, do you have any ideas how this could be fixed? 🤔

mislav commented 4 years ago

Not at the moment! But when they are not in the block scope, define_method and attr_accessor already work as desired (they don't generate tags for dynamic arguments); so I would argue that this regression is something specific to the block scope mode.

vittorius commented 1 year ago

@mislav Do you still maintain this project at this moment? If yes, what kind of effort and/or help is still needed to push this PR through review and into the master?

vittorius commented 1 year ago

Yay, thanks, guys! 🎉