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

Author here, thanks for sharing!

I'm really excited for where some of the extensions in the article are going - the RubyLSP has been improving slowly and steadily and I'm hoping that this is the year it gets _really good_. Other extensions like the StimulusLSP are niche, but awesome, and on the Twitter thread for this article (https://twitter.com/hrrsnbbnt/status/1759900961760477681) someone even pointed me to a new ERB formatter that looks promising.

TLDR; Rails is alive and well! Ruby has never been a first-class citizen of VS Code, but there's still some awesome extensions out there to give you a decent experience. And it's getting better!



I saw no mention of RBS+Steep, the latter providing a LSP. I use it a lot and very much like it, although it's still young and needs love, but it's making good, steady progress! I've been very pleasantly surprised by some of the crazy things Steep can catch, completely statically!

You appear to be working on projects with Sorbet (which I tried to like but found it fell short in practice, notably outside of the app use case i.e it's mostly useless when authoring a gem) so it may be a tall order to try on those. Maybe you can give RBS+Steep a shot on some small project?

RBS: https://github.com/ruby/rbs

RBS collection (for those gems that don't ship RBS signatures in `sig`, integrates with bundler): https://github.com/ruby/gem_rbs_collection

Steep: https://github.com/soutaro/steep

VS Code: https://github.com/soutaro/steep-vscode

Sublime Text: https://github.com/sublimelsp/LSP

Vim (I'm working on it): https://github.com/dense-analysis/ale/pull/4671


Nice! Does the Steep LSP for VS Code give you nice intellisense even if you don't have rbs files? How's the speed?


If you want good results with intellisense/omnicomplete you need sigs. Steep does some type synthesis but giben Runy's very dynamic nature it's going to be hit and miss, so that's mostly for progressive typing. It really aims at leveraging static information.

The process is basically `rbs prototype` or `typeprof` to generate a sig file and steep then uses that. TBH it's not that much of a chore as it sounds and already gives you good-ish results. That gives you a bunch of material to work from and progressively refine types.

Speed is very good, I didn't notice anything slow.


For context, the reason I ask is that I am developing some Ruby gems, and considering whether it's worth adding .rbs files.

In the Python libraries I maintain, types are useful to anyone who installs the default Python VS Code plugin, because it gives them intellisense (but doesn't give them red squiggly lines for type errors) even if they do nothing to set up types or a typechecker.

Is that or will that be the case for Ruby/Steep?


Yes! Totally one of the use cases.

We plan to do that at some point for the Ruby Datadog tracer public API, so that users can have intellisense and don't need to jump to the docs.


Mind linking the ERB recommendation? Can’t see the replies without an account.





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

Search: