これを使います。
castwide/vscode-solargraph: A Visual Studio Code extension for Solargraph.
ただし、この拡張を入れるだけでは動作しません。
まずは Gemifile に solargraph を追加します。
group :development do
...
gem 'solargraph'
end
`bundle install` でインストールの実行。
インストールしたら、`which solargraph` で solargraph のパスを調べます。
❯ which solargraph
/Users/ougi/.rbenv/shims/solargraph
プロジェクトの `.vscode/settings.json` に上記のパスを記載します。
{
"solargraph.commandPath": "/Users/ougi/.rbenv/shims/solargraph"
}
続いて、solargraph の設定をカスタムします。
`solargraph config` を実行すると、プロジェクトルートに `.solargraph.yml` ファイルが生成されます。require配列に以下のように書き加えます。
require:
- actioncable
- actionmailer
- actionpack
- actionview
- activejob
- activemodel
- activerecord
- activestorage
- activesupport
最後に、 `solargraph bundle` を実行して、bundle gems のドキュメントを生成します。


コードヒントが出るようになりました!