castwide / solargraph

A Ruby language server.
https://solargraph.org
MIT License
1.89k stars 158 forks source link

undefined method `scope' for #<Solargraph::Pin::ProxyType `` at nil> #646

Open tim-wovn opened 1 year ago

tim-wovn commented 1 year ago

Hello! I'm not too familiar with solargraph but am experiencing a problem with an existing ruby on rails project (Ruby 3.1.2; Rails 7.0.2) at my work that uses solargraph. Specifically, we use it in our CI workflows to validate all PRs with typechecking before merging.

I tried upgrading from solargraph 0.48.0 to 0.49.0 but that is when the problem appeared.

In our project, we run the following: bundle exec solargraph bundle && bundle exec solargraph typecheck --level typed

1) ~With 0.49.0 if I run bundle exec solargraph bundle I get the message:~ ~Thebundlecommand is deprecated. Solargraph currently uses RBS instead.~

~It's not clear to me what that means; should I run some alternative command instead?~

It seems that bundle exec solargraph bundle no longer needs to be run: https://github.com/castwide/solargraph/issues/464#issuecomment-1501560419

2) If I ignore that issue and run: bundle exec solargraph typecheck --level typed

I get the error:

{project}/vendor/bundle/ruby/3.1.0/gems/solargraph-0.49.0/lib/solargraph/source/chain/call.rb:202:in `super_pins': undefined method `scope' for #<Solargraph::Pin::ProxyType `` at nil> (NoMethodError)

pins = api_map.get_method_stack(name_pin.namespace, name_pin.name, scope: name_pin.scope)\r

Thank you for your work on solargraph! 🙇