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

Plugin doesn't seem to handle paths with spaces properly. #7

Closed ams-tschoening closed 4 years ago

ams-tschoening commented 4 years ago

This plugin has been suggested as a replacement for DLTK, but after installing and restarting Eclipse errors like the following get logged when it tries to install itself:

Unexpected exit value 1 from command [cmd.exe, /c, gem install -V -n C:\Users\tschoening\Documents\Eclipse\Ruby GitHub\.metadata\.plugins\io.github.pyvesb.eclipse_solargraph solargraph]

Error details: ERROR: Could not find a valid gem 'GitHub.metadata.plugins\io.github.pyvesb.eclipse_solargraph' (>= 0) in any repository

The problem most likely is that the path containing spaces is not quoted properly. The following executed manually on the shell succeeds:

cmd.exe /c gem install -V -n "C:\Users\tschoening\Documents\Eclipse\Ruby GitHub\.metadata\.plugins\io.github.pyvesb.eclipse_solargraph" solargraph

Source line:

String[] command = CommandHelper
            .getPlatformCommand("gem install -V " + "-n " + pluginStateLocation + " " + gem.toLowerCase());
PyvesB commented 4 years ago

Hello @ams-tschoening,

Thanks for reporting this issue! Your analysis sounds correct, adding double quotes in GemHelper on lines 32 and 55 would probably solve the problem.

Would you like to submit a pull request with the fix?