A challenge to create a little Rails app for tasting whiskey
For whiskey lovers only
gem install overmind
bundle install
srb tc
config/database.yml
rake db:create
rake db:migrate
overmind s
To type check your code you can do two things:
Run srb tc
to type check your code from the terminal.
If you have updated your Rails model, you can have the Rails-Sorbet gem
regenerate your type signatures:
bundle exec rake rails_rbi:all
This is not perfect and exhaustive but it will pick up most things. Ruby and
Rails are very dynamic and not everything can be picked up yet.
Use the sorbet-lsp
extension to have checks and code completion.
https://marketplace.visualstudio.com/items?itemName=danhuynhdev.sorbet-lsp
To use this, disable the SolarGraph extension if you have it running, since this
extension has its own language server.
I noticed that this server has its niggles. For example, the robocop extension
interferes with it sometimes and makes it crash, so disable that extension.
Also sometimes to have it pick up new types you have to reload the window.
Always reload the window after generating new rails types:
Cmd+Shift+P -> Developer: Reload Window