top | item 46609178

(no title)

vmware508 | 1 month ago

I guess it is still useless in Ruby or Ruby on Rails. Standard "find the method declaration" or "used here" do not work in Ruby on Rails. Still, huge companies maintain that Ruby on Rails mess, where you cannot properly investigate, so you just guess and use the search and find option. Those codebases won't be replaced for a while, but good luck working on them. Such a headache!

discuss

order

rochak|1 month ago

Man am I glad I don't have to work with Ruby anymore

TheRoque|1 month ago

How come nobody came up with an LSP that can perform this, all this time ?

federicotdn|1 month ago

I've developed a small tool[1] that has helped me for the same problem, but in Python. Basically just uses simple parsers to attempt to find a definition wherever is sensible. Adding a Ruby module should not be too difficult, but it would probably be trickier than Python to get some good enough results

[1] https://github.com/federicotdn/irk

IshKebab|1 month ago

Because it's an unsolvable problem without static type annotations and as far as I'm aware Ruby doesn't have a good solution for those yet (or if they do nobody uses it).

louiskottmann|1 month ago

First of all, ruby-lsp does a great job at this, and the recent Herb helps with frontend templates.

This is enough to navigate between controllers, models and libs, unless you're trying hard to be clever which you shouldn't.

Then, in Rails, things have a canonical place in the codebase, that is consistent between codebases.

This is in contrast to languages and frameworks where every codebase is setup differently, but the static typing helps find code wherever it's hidden without pain, and thus without need for cleanup and thoughtful design.

To each their own, I prefer power for me, and pain for whoever drifts from the convention.