Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Most definitely. When I worked with existing Ruby codebases, it was surprisingly hard to answer the question "where is this defined" when every import is dumped into a single global namespace. I had no idea where stuff came from, and neither the IDE.


Use the `method` method to get a reference to the one you are concerned with, then call `source_location` on it.


That's only during runtime. Simply reading code can be annoyingly difficult without hard references. Especially when the code is coming from a gem.

Many times LSP's can't figure out where the code is coming from if it's a few layers deep. Then you're stuck with the time consuming method of running the code and doing something like what you're describing above just to read it.


As someone who has no idea how Ruby works, how does Emacs show where any function is defined, right down to line number? Emacs has a big mudball of single namespace too


And even good type checkers can't infer every symbol statically where Python/JS has no issue with it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: