r/ruby • u/rajnaveen344 • Jun 22 '25
🚀 Announcing Ruby Fast LSP: A Blazing Fast Language Server for Ruby, Built in Rust
Hello Ruby community! 👋
I'm excited to introduce Ruby Fast LSP, a high-performance Language Server Protocol implementation for Ruby, built from the ground up in Rust using the Prism parser.
VS Code Extension: https://marketplace.visualstudio.com/items?itemName=naveenraj.ruby-fast-lsp
🔥 Key Features:
Lightning Fast - Built with Rust for near-instantaneous code analysis
Full LSP Support - Go to definition, references, hover info, completions, and more
Workspace-Aware - Seamlessly navigate across your entire project
Modern Tooling - Built on Ruby Prism for reliable parsing
I've been working on this to solve the performance issues I've experienced with existing Ruby language servers, especially on larger codebases and configuring it for older version of Ruby projects. The goal is to make Ruby development in VS Code and other editors as smooth as possible.
This is still in active development (consider this pre-alpha), and I'd love to get feedback or any help from the community. Whether you're a Ruby developer, Rust enthusiast, or just interested in language tooling, your input would be incredibly valuable.
There is still so much work to do to make it comparable to Rubymine and Shopify's ruby-lsp and I'm looking forward to your feedback and criticism.
PS: This is my first open-source project, so any help in any way is appreciated
3
u/TronnaLegacy Jun 23 '25
Interesting project. I tried it out with a new Ruby project to test some basic features. Some stuff seems to work for me, like "go to definition" where I use a method on a class I define, but some stuff doesn't, like "find all references" for that method on the class definition, and code completion for methods. Should we file issues on GitHub for stuff like that not working?
2
u/rajnaveen344 Jun 23 '25
Thanks for trying out!! :D Yea goto/references implementation for methods is in partial support state as of now. The VSCode readme has what is implemented and what is not.
Please feel free to file issues. I'll take a look this weekend.
1
u/TronnaLegacy Jun 23 '25
Oh I see. There's a bit of a mismatch then between the features available according to the GitHub readme vs the Marketplace page. I was going off what I was reading on the Marketplace page said it could do.
Oh wait. Maybe not. I need to read more carefully.
> Methods (limited support) 🚧
4
u/Rockster160 Jun 22 '25
I can’t use the existing LSP because of the extending comment “feature” where it automatically adds a comment to a line when you move to a new line from an existing comment. It’s insanely frustrating to me and I can’t believe such a feature exists without being able to toggle it off. So instead I deal with a lot of VSC’s poor indentations and such. If your extension does not include that, I’d love to give it a shot. 🙂
1
u/myringotomy Jun 22 '25
There are a lot of annoying auto complete things but are you sure that's not copilot or whatever AI you are using?
1
u/Rockster160 Jun 22 '25
Yes. 100%. I narrowed it down specifically to the ruby-lsp library. And it’s not an autocomplete, it’s more like a snippet/setting. Other languages have a way to disable it, but not ruby-lsp.
1
u/rajnaveen344 Jun 23 '25
Ah, yes. A way to toggle it is a nice-to-have. I'll consider this. Thanks :)
3
u/PuercoPop Jun 23 '25
It is part of their type formatting feature. It doesn't have a fine-grained toggle, but you can disable it, by disabling the feature altogether with
"editor.formatOnType": trueAdding toggle here should be straightforward if one is interested in contributing https://github.com/Shopify/ruby-lsp/blob/e456bdfbaf9fe33135da891c4bf5616473249f4c/lib/ruby_lsp/requests/on_type_formatting.rb#L53
2
u/TadpoleNo1549 Apr 14 '26
this is seriously impressive for a first open source project, rust plus prism for a fast ruby lsp sounds like a great combo, especially for large codebases, love that you’re tackling real pain points instead of just another tool, definitely curious to see how it evolves compared to ruby lsp and rubymine
1
u/rajnaveen344 May 16 '26
Thank you for the kind words. Definitely looking to solve more pain points, especially extension interface. Meta programming is a pain in the ass. Will soon post a new post about how I'm planning to make it work. A small glimpse is I build a ruby sdk that gets compiled into a wasm and communicates with the main LSP server. The SDK will provide the necessary hooks and interface to manipulate the index.
39
u/vassyz Jun 22 '25
I just wish we had one good tool instead of so many that feel incomplete. Don't get me wrong, I really appreciate what you are doing, but compared to 6–7 years ago when I was using Solargraph to now using Ruby LSP, I hardly feel we've made much progress for the end-user experience.
6
u/TronnaLegacy Jun 23 '25 edited Jun 27 '25
I like OP's approach to use the right tool for the job though. Ruby is a good tool for making web apps, but things like Rust can be the right tool for making quick CLI tools.
I know where you're coming from when you say the community needs better recommended tools for people to choose as defaults. I watched https://www.youtube.com/watch?v=WvyZypFIRYw where the presenter makes that case too. OP could suggest this LSP as a tool that could receive an endorsement if the community ends up going that route.
3
u/Boratsky Jun 22 '25
>Neovim: Install the Ruby Fast LSP
Project does not state anywhere how to install it.
10
u/rajnaveen344 Jun 22 '25
u/Boratsky I initially planned to add support for Neovim, but never really got to it. I will update the readme to represent the project state correctly.
Nevertheless, I do plan to add support for Neovim in future.
2
u/oh_why_why_why Jun 22 '25
Hey OP, great project, thanks. Once Support for Neovim drops, will you please let us know here? Thank you. .
5
u/rajnaveen344 Jun 22 '25
Never realised so many people used Neovim for Ruby development ;)
I will update here and in this sub once it is implemented. Thanks.
2
u/realflow Jun 22 '25
Thank you, Ruby needs a good LSP which didn't exist to this date ❤️
6
u/rajnaveen344 Jun 22 '25
True, Ruby is such a joyous language to write. But, without good tools, it's a little hard to maintain large projects and also not everyone can afford RubyMine. Hopefully, this LSP will support all that is required in future to make development in Ruby easier.
7
u/InternationalLab2683 Jun 22 '25
I’ve always found it unfortunate that Ruby-a pioneer in open source-has to rely on a proprietary tool like RubyMine for a solid IDE experience, even for basic language support.
That’s why it’s always exciting to see progress being made in the area of Language Server Protocols (LSPs).
Personally, I find Solargraph more feature-complete (albeit slower) than ruby-lsp, which is why I still use it and even created the solargraph-rspec plugin.
I’d really love to see Ruby LSPs embrace YARD annotations more fully, especially since they’re so widely used in third-party gems for type inference. I hope adding support for YARD will be on your roadmap.
Keep up with good work!
0
5
u/brandn487 Jun 22 '25
Ruby has a good LSP already. Ruby needs its small community to collaborate and improve existing tools in order to improve the experience for new devs and help the community grow. The community isn't big enough to maintain many different options for every tool like JavaScript. This is a cool project, but I think it would be better for community efforts to be focused on improving the Shopify LSP instead.
10
u/ill_never_GET_REAL Jun 22 '25
Nah, I think it's cool for people to release little projects, even if they duplicate some of what's in a big one. On the LSP specifically, I've found a similar issue with projects using Ruby < 3.0, and who's to say that Shopify is interested in contributions that would add that support?
I also think it's healthy for a dev community to have alternatives that don't come from enormous, profit-making businesses.
0
Jun 22 '25
[deleted]
5
u/ill_never_GET_REAL Jun 22 '25
it can be trivially forked.
And if it were, you'd be back in here arguing whether it was the right time to "fracture the ecosystem"? ;)
Just pulling your leg - I get your point but I think we should default to being supportive of people (like OP) building stuff with Ruby or for the Ruby community.
4
u/Unable-Swimming-9899 Jun 22 '25
Congratulations!, A fast lsp for ruby is indeed a very good idea if you make the project stable. Some most of the ruby lsp features are fast, but does mot feel "instanct" like other languages.
Consider putting on your roadmap an add ons system like the one in RubLsp, that could make the lsp more useful for other tools and bring other parts of the community to use your LSP.
A blazing fast rust lsp with rust lsp Addons sound like performance endgame to me 🚀.
1
u/keremimo Jun 22 '25
Hey, really good job! Any plans on implementing it to Neovim as well?
6
u/rajnaveen344 Jun 22 '25
Thanks a lot! I also plan to create extensions for other editors. In the pipeline are Neovim, Zed and Sublime(?)
4
u/keremimo Jun 22 '25
Really nice. I work as a Rails dev, will definitely have a look in the future.
4
u/rajnaveen344 Jun 22 '25
Meta programming is such a pain to think about in terms of LSP. I will post here once the support drops for Rails. Thanks.
2
u/rupek1995 Jun 22 '25
It’s literally in the project’s readme
-17
u/keremimo Jun 22 '25
You could have been a little nicer. I don’t read readmes of every project I come across and it wasn’t mentioned in the post.
1
2
u/AshTeriyaki Jun 22 '25
Would be good to see if it works with helix. Helix supports LSPs out of the box
-1
u/katafrakt Jun 23 '25
so, like every modern editor?
2
u/AshTeriyaki Jun 23 '25
No, when I say out of the box, I mean config free. With Helix you just install an LSP and it picks it up. You can add additional config if you want later on.
1
u/flaC367 Jun 25 '25
If i can F2 to refactor var/fn names and CTRL+click Jump to definition, is enough to me
1
u/HalfAByteIsWord Jun 25 '25
This is great for us because we use JRuby and we can't install the ruby-lsp with JRuby since they moved Prism parser. I'll definitely give this a try. I'm using Neovim BTW, I will see if I can get it to work.
1
u/hmaddocks Jun 30 '25
You're fighting an uphill battle to replace anything coming out of Shopify unfortunately.
0
-4
u/Neuro_Skeptic Jun 22 '25
Why not built in Ruby?
2
u/rajnaveen344 Jun 22 '25
Tbh, I started this as a toy project to learn Rust (its type system is amazing). But over time, I started using this LSP as my primary tool because I wanted to use Copilot in VSCode and AI integration in Rubymine is not so good. Performance gain is a side effect :P
1
0
u/ApatheticBeardo Jun 24 '25
Because Ruby is dog-ass slow for anything interactive.
And you know it, you're just pretending not to.
15
u/twnsnd Jun 22 '25
You mentioned it’ll take a lot to become comparable to Shopify’s Ruby LSP, what are the advantages over using their LSP?