PyvesB / eclipse-solargraph

:gem: Ruby development tools for Eclipse.
https://marketplace.eclipse.org/content/ruby-solargraph
Eclipse Public License 2.0
30 stars 6 forks source link

Not picking up the first `ruby` in the path #34

Closed stormwatch closed 2 months ago

stormwatch commented 2 months ago

Hi! I am not sure if this is a bug or a misconfiguration. I'm a first time Eclipse user.

I installed latest ruby 3.3.4 via asdf and configured it ”globally” (asdf global ruby 3.3.4):

❯ which ruby /Users/eze/.asdf/shims/ruby

❯ asdf which ruby /Users/eze/.asdf/installs/ruby/3.3.4/bin/ruby

yet when I click on the run button the console says:

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- minitest/reporters (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from /Users/eze/eclipse-workspace/RubyExceptions/test_helper.rb:4:in <top (required)>' from /Users/eze/eclipse-workspace/RubyExceptions/exceptions_test.rb:1:inrequire_relative' from /Users/eze/eclipse-workspace/RubyExceptions/exceptions_test.rb:1:in `

'

The following reference was added by github:

          Hello @flat-linex 👋🏻 

The plugin simply uses the first Ruby installation that is found on the path. If you configure JRuby to be the default, the plugin should use that. 😉

Originally posted by @PyvesB in https://github.com/PyvesB/eclipse-solargraph/issues/26#issuecomment-1279783553

stormwatch commented 2 months ago

The debugger, on the other hand, seems to pick the correct version:

Content-Length: 344

{"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true,"exceptionBreakpointFilters":[{"filter":"raise","label":"Break on raised exceptions","description":"The debugger will break when an exception is raised, regardless of whether it is subsequently rescued.","default":false}]}}Content-Length: 38

{"type":"event","event":"initialized"}Content-Length: 79

{"type":"response","request_seq":2,"success":true,"command":"launch","body":{}}Content-Length: 90

{"type":"response","request_seq":3,"success":true,"command":"configurationDone","body":{}}Content-Length: 115

{"type":"event","event":"process","body":{"name":"/Users/eze/eclipse-workspace/RubyExceptions/exceptions_test.rb"}}Content-Length: 74

{"type":"event","event":"thread","body":{"reason":"started","threadId":1}}Content-Length: 74

{"type":"event","event":"thread","body":{"reason":"started","threadId":1}}Content-Length: 331

{"type":"event","event":"output","body":{"output":"[TypeError] no implicit conversion of nil into String\n<internal:/Users/eze/.asdf/installs/ruby/3.3.4/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'\n<internal:/Users/eze/.asdf/installs/ruby/3.3.4/lib/ruby/site_ruby/3.3.0/rub","category":"stderr"}}Content-Length: 332

{"type":"event","event":"output","body":{"output":"ygems/core_ext/kernel_require.rb>:136:in require'\n/Users/eze/eclipse-workspace/RubyExceptions/test_helper.rb:3:in<top (required)>'\n/Users/eze/eclipse-workspace/RubyExceptions/exceptions_test.rb:1:in `require_relative'\n/Users/eze/eclipse-workspace/RubyE","category":"stderr"}}Content-Length: 331

{"type":"event","event":"output","body":{"output":"xceptions/exceptions_test.rb:1:in <top (required)>'\n/Users/eze/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/readapt-2.0.0/lib/readapt/debugger.rb:66:inload'\n/Users/eze/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/readapt-2.0.0/lib/readapt/d","category":"stderr"}}Content-Length: 331

{"type":"event","event":"output","body":{"output":"ebugger.rb:66:in block (2 levels) in start'\n/Users/eze/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/readapt-2.0.0/lib/readapt/debugger.rb:80:inrun'\n/Users/eze/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/readapt-2.0.0/lib/readapt/debugger.r","category":"stderr"}}Content-Length: 37

{"type":"event","event":"terminated"}

PyvesB commented 2 months ago

Hello @stormwatch ! 👋🏻

Thanks for the report. I've just pushed a commit that should fix this. Will release a new plugin version towards the end of this week. :)

PyvesB commented 2 months ago

@stormwatch the new version has been released, let me know whether it works for you!

stormwatch commented 2 months ago

Thank you!

I've just tried it. It gets stuck at Initializing language server "Solargraph Language Server" (28%). Unfortunately I don't know how to peek inside. If you provide some instructions or point me to some docs I could try to debug the plugin.

ps -aef | rg -i solar shows solargraph is not running

PyvesB commented 2 months ago

In Eclipse's preferences, Language Servers -> Logs, you can enable additinal logging which may help investigate the issue. Feels free to also open a new issue issue :)