castwide / atom-solargraph

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

Struggling to get it working! #3

Open kdthomas2121 opened 6 years ago

kdthomas2121 commented 6 years ago

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!

castwide commented 6 years ago

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 commented 6 years ago

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.

flvrone commented 6 years ago

@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
castwide commented 6 years ago

@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 commented 6 years ago

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.

michielboekhoff commented 6 years ago

@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.

castwide commented 6 years ago

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 commented 6 years ago

Version 0.3.0 with LSP support is published.

flvrone commented 6 years ago

@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 commented 5 years ago

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

castwide commented 5 years ago

@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.

svoop commented 5 years ago

@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/.

castwide commented 5 years ago

@svoop The master branch now includes two important updates:

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

flvrone commented 5 years ago

@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 commented 5 years ago

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

castwide commented 5 years ago

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 commented 5 years ago

Version 0.4.0 is released with the commandPath configuration option.