You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The various Ruby intellisense tools are ok at knowing that there are Book and Author constants, and some (including Solargraph) are aware that objects like Book.new have a .label method. But what about those "magical" dynamic methods that ActiveRecord creates like .title, or .author?
Since these attributes are only created at runtime, a simple static analysis of the Book class alone can't identify them. Your editor has no idea that these attributes exist, but they're amongst the most common things that you will work with in any Rails app.
That's where this plugin for Solargraph comes in: it understands db/schema.rb and any comments from the annotate_models gem for models, and also supplies key annotations and Rails-specific context on top of what Solargraph pulls via YARD and RBS. As a result, you have access to database attributes:
... and ActiveRecord finders:
... and associations:
... and routes file syntax:
and more!
Installation
Install solargraph and solargraph-rails
If you add them to your Gemfile, you'll have to tell your IDE plugin to use bundler to load the right version of solargraph.