5 ms·
How come nobody came up with an LSP that can perform this, all this time ?
by TheRoque 9mo ago
How come nobody came up with an LSP that can perform this, all this time ?
- esafak 9mo agohttps://shopify.github.io/ruby-lsp/rails-add-on#go-to-definition https://shopify.github.io/ruby-lsp/rails-add-on#go-to-defini... ?
- IshKebab 9mo agoBecause 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).
- 1-more 9mo agoSorbet is a decent one. I don't think it ever solved "jump to definition" though. I would just `rg def (self\.)?function_name` or I eventually developed a vibe for where things were, which is sort of the Ruby excuse for the ungreppability of everything. Sorbet did allow us to generate front end types in Elm and also allowed for type safe Haskell FFI. Past tense because it's an old job; as far as I know it's still happening.
- hiccuphippo 9mo agoSomeone needs to make TypeScript for Ruby.
- federicotdn 9mo agoI'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 https://github.com/federicotdn/irk