atom-solargraph icon indicating copy to clipboard operation
atom-solargraph copied to clipboard

Struggling to get it working!

Open kdthomas2121 opened this issue 7 years ago • 17 comments

I've verified it's running in the console, received "Solargraph package activated." It then prints that a lot of required paths aren't found.

However, I'm struggling to get it to autocomplete, I've tried running the example in the readme to get capitalise to show, but when I write "string." nothing appears, even after pressing control space

Any help would be appreciated!

kdthomas2121 avatar Feb 05 '18 16:02 kdthomas2121

Try updating the gem first. Today I published version 0.17.1. It resolves an issue with infinite recursion loops in some workspace environments.

Since you're getting messages about required paths in the console, I assume you're using it on an existing project. Sometimes it can take a while to process the maps on very large projects. Rails apps are especially susceptible to this. After the initial mapping, requests should become much faster.

Make sure you're capitalizing String to get class method suggestions. Results are case-sensitive.

If you still have problems, please let me know your OS, the versions of the Solargraph gem and the Atom package, and any errors you see in the console.

castwide avatar Feb 05 '18 17:02 castwide

Version 0.2.0 of the package fixes an issue with project directories that might resolve your problem. There's also a new version of the gem, so be sure to gem update solargraph.

castwide avatar Feb 16 '18 16:02 castwide

@castwide how to verify it's running? I'm running this in terminal - solargraph socket, and receive Solargraph is listening PORT=7658 PID=13393 Then I run atom, also from terminal, ruby versions are same (2.5.0), package installed & enabled, but I can't see it's working. I'm tunning everything from my project folder, and I'm also having file .solargraph.yml in my project folder with the following content:

plugins:
  - runtime

flvrone avatar Apr 26 '18 09:04 flvrone

@FunkyloverOne The Atom package is a little behind insofar as recent updates to the gem. Among other things, it still uses the old web API for integration instead of the language server protocol. I'm in the process of updating the package to use LSP.

Plugins are still experimental and prone to bugs, so you might need to remove them from .solargraph.yml.

You don't need to run solargraph socket for Atom, although it shouldn't affect anything. The package starts its own server process when it gets activated.

Unfortunately, other problems are likely to persist until the package is updated. Related issue: https://github.com/castwide/atom-solargraph/issues/5

castwide avatar Apr 26 '18 13:04 castwide

It occurred to me that you might be able to get it to work with an earlier version of the gem, so I tested a few of them and was able to get results with v0.17.4.

Installing the gem:

gem uninstall solargraph
gem install solargraph -v 0.17.4

Results in Atom:

image

You still might encounter issues that have been resolved in the latest gem. I'll update #5 when the package is able to use it.

castwide avatar Apr 26 '18 13:04 castwide

@castwide this tool is awesome! Got it working today using the master branch. For anyone else struggling to get this running, I ran apm install https://github.com/castwide/atom-solargraph.git from the command line and it works with the latest version of the gem.

michielboekhoff avatar May 06 '18 19:05 michielboekhoff

Thanks, @michielboekhoff! The master branch currently uses the language server protocol as mentioned in #5. I have a few more changes and tests to run before I publish the Atom package, but it should be close to ready.

castwide avatar May 06 '18 22:05 castwide

Version 0.3.0 with LSP support is published.

castwide avatar May 13 '18 10:05 castwide

@castwide For me version 0.3.0 still doesn't seem to work at all... I got my ruby installed via ruby-install+chruby, and stuff like linter-rubocop and linter-reek is working. Doesn't seem to work with solargaprh v0.17.4 neither.

In atom console I got this error:

Uncaught (in promise) /bin/bash: solargraph: command not found

Screenshot

I guess I know how to fix it - you simply got to provide configuration parameter for solargraph executable path, just like linter-rubocop and linter-reek are doing.

flvrone avatar Jul 04 '18 17:07 flvrone

Hey @castwide I see that you already have a commandPath config param in your solargraph-utils here: https://github.com/castwide/solargraph-utils/blob/b3f73eef3a35264ad5d36a82a4a9dd4f8e913690/src/Configuration.ts#L9

So it's only needed to add such config to this package and pass it to SocketProvider

flvrone avatar Nov 25 '18 20:11 flvrone

@FunkyloverOne That should work, yes. I'll work on an update to atom-solargraph. I'm also in the process of an update to solargraph-utils that should help fix some other issues related to starting the server process.

castwide avatar Nov 26 '18 15:11 castwide

@castwide Any news on this? It'd be very cool to use solargraph together with chruby.

PS: As a workaround, symlinking the solargraph binary into the PATH helps. In my case, I do something along the lines of ln -s ~/.gem/ruby/2.6.1/bin/solargraph /usr/local/bin/.

svoop avatar Feb 14 '19 14:02 svoop

@svoop The master branch now includes two important updates:

  • It uses the latest version of solargraph-utils, which improves automatic environment detection.
  • It adds a commandPath configuration option.

I expect to publish the package in the next few days.

castwide avatar Feb 19 '19 19:02 castwide

@castwide I can confirm that I've finally succeeded! :D

I had to start Atom from terminal though. Currently linter-rubocop and linter-reek are working somehow even without having to start Atom from terminal, I have no idea how they are doing it.

Yet what we have now is a good start indeed! Thank you!

flvrone avatar Feb 20 '19 12:02 flvrone

Hey @castwide, here's what does the trick for reek and rubocop I believe: https://github.com/steelbrain/atom-linter/issues/62

flvrone avatar Mar 04 '19 15:03 flvrone

Thanks, @FunkyloverOne. That looks promising. Since the current version of atom-solargraph seems like a step in the right direction for most users, I'll still release it this week, but I'll refer to that thread for possible improvements.

castwide avatar Mar 04 '19 16:03 castwide

Version 0.4.0 is released with the commandPath configuration option.

castwide avatar Mar 09 '19 16:03 castwide