castwide / atom-solargraph

An Atom package for Solargraph.
MIT License
39 stars 5 forks source link

Not working in Atom for me #2

Closed sanchit121 closed 5 years ago

sanchit121 commented 6 years ago

Just followed basic steps. No autocomplete results showing. Neither any error. have installed solargraph gem also

castwide commented 6 years ago

Are you editing a file with an .rb extension? The console should report that Solargraph was activated even if there weren't any errors.

sanchit121 commented 6 years ago

Hi castwide, thanks for your kind input Here are console logs. please help.

Solargraph package activated. SolargraphServer.js [sm]:32 /Users/sanchitagarwal/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem solargraph (>= 0.a) (Gem::GemNotFoundException)

SolargraphServer.js [sm]:32 from /Users/sanchitagarwal/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems.rb:299:in activate_bin_path' from /Users/sanchitagarwal/.rvm/gems/ruby-2.4.2/bin/solargraph:23:in

' from /Users/sanchitagarwal/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in eval' from /Users/sanchitagarwal/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in
'

Thanks

castwide commented 6 years ago

Thanks, @sanchit121. Since you're using RVM, you may need to make sure the Solargraph gem is installed on the same version of the gem that Atom is using. The errors indicate it's using Ruby 2.4.1. You can run ruby -v or which ruby from a command line for more information.

Ruby managers like RVM are known to cause issues with Solargraph in certain environments. I'm in the process of fixing that problem in the VS Code extension and will port the fix to the Atom package in the next version.

castwide commented 6 years ago

Version 0.1.1 of the Atom package is published. This update should resolve issues with Ruby install managers and provide some minor improvements to performance.

sanchit121 commented 6 years ago

Yup, thanks for fixing, its working for me now. Thanks

sanchit121 commented 6 years ago

Hi, it gives context specific suggestions also, like i have Article model which has title, description, so will it give Article.find_by_title.? etc.

On Thu, Feb 1, 2018 at 1:19 AM, Fred Snyder notifications@github.com wrote:

Version 0.1.1 of the Atom package is published. This update should resolve issues with Ruby install managers and provide some minor improvements to performance.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/castwide/atom-solargraph/issues/2#issuecomment-362049514, or mute the thread https://github.com/notifications/unsubscribe-auth/AdZmU7mGKIU8rq1Br5dBlJGH8RIKdEufks5tQMPbgaJpZM4Ry1u6 .

castwide commented 6 years ago

Solargraph uses a combination of static analysis and YARD documentation to provide suggestions. Magic methods--i.e., anything injected dynamically at runtime--can't always be detected statically. Rails is especially prone to this limitation.

One way I'm trying to improve dynamic method detection is the runtime plugin as described in the gem's README, but it's highly experimental, and its detection of Rails magic methods is incomplete.