Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struggling to get it working! #3

Open
kdthomas2121 opened this issue Feb 5, 2018 · 17 comments
Open

Struggling to get it working! #3

kdthomas2121 opened this issue Feb 5, 2018 · 17 comments

Comments

@kdthomas2121
Copy link

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
Copy link
Owner

castwide commented Feb 5, 2018

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
Copy link
Owner

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.

@FunkyloverOne
Copy link

FunkyloverOne commented Apr 26, 2018

@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
Copy link
Owner

@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: #5

@castwide
Copy link
Owner

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
Copy link

@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
Copy link
Owner

castwide commented May 6, 2018

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
Copy link
Owner

Version 0.3.0 with LSP support is published.

@FunkyloverOne
Copy link

FunkyloverOne commented Jul 4, 2018

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

@FunkyloverOne
Copy link

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
Copy link
Owner

@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
Copy link

svoop commented Feb 14, 2019

@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
Copy link
Owner

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

@FunkyloverOne
Copy link

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

@FunkyloverOne
Copy link

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

@castwide
Copy link
Owner

castwide commented Mar 4, 2019

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
Copy link
Owner

castwide commented Mar 9, 2019

Version 0.4.0 is released with the commandPath configuration option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants