Andy Waite
Andy Waite
I'm going to close this for now until we address JRuby support in https://github.com/Shopify/ruby-lsp/issues/1263. If we can find a way to support it, then we can add it to CI.
Re-opening this for tracking JRuby since https://github.com/Shopify/ruby-lsp/issues/1263 was resolved.
If Zed implemented language server support for `textDocument/foldingRange` then it could use Ruby LSP's implementation which collapses the whole `def`. Doesn't seem on the radar though: https://github.com/zed-industries/zed/issues/26916
- https://github.com/zed-industries/zed/issues/26916#issuecomment-2752637321
- https://github.com/zed-industries/zed/issues/28091
Here's a shorter illustration (via @vinistock): https://sorbet.run/#%23%20typed%3A%20true%0Aextend%20T%3A%3ASig%0A%0Asig%20do%0A%20%20params%28%0A%20%20%20%20option_values%3A%20T%3A%3AHash%5B%3A%3AString%2C%20%3A%3AString%5D%2C%0A%20%20%20%20validate%3A%20T%3A%3ABoolean%0A%20%20%29.void%0Aend%0Adef%20foo%28option_values%20%3D%20T.unsafe%28nil%29%2C%20validate%3A%20T.unsafe%28nil%29%29%3B%20end%0A%0Ahash%20%3D%20T.let%28%7B%22min%22%3D%3E%221%22%7D%2C%20T%3A%3AHash%5B%3A%3AString%2C%20%3A%3AString%5D%29%0Afoo%28hash%29%0A If we change `validate: T.unsafe(nil)` to `validate = T.unsafe(nil)` then it typechecks: https://sorbet.run/#%23%20typed%3A%20true%0Aextend%20T%3A%3ASig%0A%0Asig%20do%0A%20%20params%28%0A%20%20%20%20option_values%3A%20T%3A%3AHash%5B%3A%3AString%2C%20%3A%3AString%5D%2C%0A%20%20%20%20validate%3A%20T%3A%3ABoolean%0A%20%20%29.void%0Aend%0Adef%20foo%28option_values%20%3D%20T.unsafe%28nil%29%2C%20validate%20%3D%20T.unsafe%28nil%29%29%3B%20end%0A%0Ahash%20%3D%20T.let%28%7B%22min%22%3D%3E%221%22%7D%2C%20T%3A%3AHash%5B%3A%3AString%2C%20%3A%3AString%5D%29%0Afoo%28hash%29%0A
This feature was added to Ruby LSP in https://github.com/Shopify/ruby-lsp/pull/2985 and uses a custom LSP request along with integration with VS Code. The PR description also shows how it can be...
I suspect it wouldn't be viable since the extension compiles down to WebAssembly, but you could perhaps have the extension auto-install a tiny gem?
Nice! Had to make a small fix to the README example: https://github.com/MoskitoHero/zed-test-toggle/pull/1
@ricsdeol or @KarimElsayad247, is your internet connection going through a proxy server?