feat(ruby): add Fuzzy Ruby Server language server support#283
Conversation
…erage - Updated GEM_NAME to a non-empty sentinel value to avoid silent failures in gem operations. - Refactored language_server_binary to separate binary resolution logic for custom paths and PATH lookups. - Added checks for the existence and executability of custom binary paths. - Enhanced testing coverage for language_server_binary, including tests for custom paths, PATH discovery, and error handling. - Introduced new methods in the WorktreeLike trait to facilitate testing. - Documented findings and suggestions for maintainability and reliability improvements.
|
@vitallium , when you get a chance, could you review it? 🙇 |
Hi @candidosales. Thanks for opening this PR! I'll review this PR after May 1st because I'm on vacation at the moment. To land it, we'll need to make sure the new LSP is disabled in the Zed settings here, otherwise it will be enabled for all users by default. Thanks! |
…dustries#55215) ## Summary Add `!fuzzy-ruby-server` to the Ruby language servers list in the default settings so it is opt-in rather than enabled for all users by default. This is a prerequisite for merging the Fuzzy Ruby Server support in the Ruby extension: zed-extensions/ruby#283 As requested by @vitallium in the review comment: https://github.com/zed-extensions/ruby/pull/283\#issuecomment-4294888519 ## Change ```diff - "language_servers": ["solargraph", "!ruby-lsp", "!rubocop", "!sorbet", "!steep", "!kanayago", "..."], + "language_servers": ["solargraph", "!ruby-lsp", "!rubocop", "!sorbet", "!steep", "!kanayago", "!fuzzy-ruby-server", "..."], ``` Release Notes: - Disabled `fuzzy-ruby-server` by default for Ruby files. --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
|
@vitallium, the zed settings PR was merged. Could you review this one when you get a chance? Thanks |
…dustries#55215) ## Summary Add `!fuzzy-ruby-server` to the Ruby language servers list in the default settings so it is opt-in rather than enabled for all users by default. This is a prerequisite for merging the Fuzzy Ruby Server support in the Ruby extension: zed-extensions/ruby#283 As requested by @vitallium in the review comment: https://github.com/zed-extensions/ruby/pull/283\#issuecomment-4294888519 ## Change ```diff - "language_servers": ["solargraph", "!ruby-lsp", "!rubocop", "!sorbet", "!steep", "!kanayago", "..."], + "language_servers": ["solargraph", "!ruby-lsp", "!rubocop", "!sorbet", "!steep", "!kanayago", "!fuzzy-ruby-server", "..."], ``` Release Notes: - Disabled `fuzzy-ruby-server` by default for Ruby files. --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Thank you! |
|
Was it the intention that this is enabled by default and thus presents an error for all Zed users editing ruby? (that fuzzy-ruby-server is not installed) And shouldn't this be documented at https://zed.dev/docs/languages/ruby ? I am genuinely confused by the intent here, these are not meant as rhetorical questions. |
Hi @stgm. My apologies for this issue. It wasn’t intentional. This is a sync problem on our side. To add a new Ruby language server, it first needs to be added to the default Zed settings, but explicitly disabled. Then we need to wait for the next stable Zed release, and only after that release a new version of the Ruby extension. Apparently, I made a mistake and missed the fact that the fuzzy server wasn’t included in a Zed release yet. I think there’s a gap in our process here. In fact, this is the second time we’ve had a similar problem, so we need to find a way to prevent issues like this in the future. Regarding the documentation, that’s also a valid point. For example, the documentation still doesn’t mention the ‘kanayago’ LS. I do plan to update the documentation. Sorry again, and thanks for raising these questions! |
|
@vitallium Thank you for the explanation, that helps :-) FWIW some context: I have no custom plain ruby language config at the moment, and Zed now uses For me it's interesting and relevant to know (in the docs, I'm not in a hurry!) whether I would want to replace other LSPs with fuzzy-ruby-server, and why; or if it would complement those servers. In the docs I kind of like how erb-formatter is presented as opt-in, just the setting to copy-paste. (Not really relevant but it's also very weird that the Tailwind thingy appears to be enabled by default.) Oh and also relevant: I'm a long time Textmate user for Rails projects (switched to Zed a year ago) and have always worked very well without language servers. But some unobtrusive assistance is of course very nice. For someone like me, the omakase approach works better than having many (conflicting) options. |
Summary
Adds Fuzzy Ruby Server as a supported language server in the Ruby extension. This was requested by the Zed team after closing zed-industries/extensions#5107 — all Ruby language servers should live in this single extension rather than in separate extensions.
Fuzzy Ruby Server is a Rust binary (not a Ruby gem), so its integration intentionally bypasses the bundler/gemset installation logic used by the other language servers.
What's included
fuzzy-ruby-serverinextension.tomlFuzzyRubyServerstruct implementing theLanguageServertrait with a customlanguage_server_binarythat:lsp.fuzzy-ruby-server.binary.pathin Zed settings (with existence validation and a clear error message if the path is invalid)fuzzybinaryWorktreeLikeandFakeWorktreewith awhich()method for testabilityInstallation
Users must install the binary manually:
Or configure an explicit path in Zed settings:
{ "lsp": { "fuzzy-ruby-server": { "binary": { "path": "/path/to/fuzzy" } } } }Test plan
cargo test)fuzzyinstalled and verify completions workfuzzyis not installed