solargraph icon indicating copy to clipboard operation
solargraph copied to clipboard

Work over stdio?

Open thisguycodes opened this issue 8 years ago • 14 comments

Hey! This is awesome! I'm using https://github.com/onivim/oni and would love to use this with it, but Oni only supports stdio for language servers at the moment: could you make solargraph work over stdio as well as it's current TCP setup? My naive self tells me this should be relatively trivial to impliment.

thisguycodes avatar Jun 07 '18 19:06 thisguycodes

Thanks!

A stdio transport is on the roadmap; in fact, it was the first transport I expected to deliver. I switched to TCP because I was able to get better performance out of it. I'll revisit the stdio implementation and post updates in this issue.

castwide avatar Jun 07 '18 20:06 castwide

this would be grand! thanks @castwide

megalithic avatar Jun 20 '18 16:06 megalithic

I have just submitted an issue to Oni for TCP support ; I had been looking for something like Oni for years - I just found out about it yesterday! Having it work with Solargarph would be amazing!

zxiest avatar Jun 24 '18 07:06 zxiest

The stdio branch includes a working implementation of the stdio transport. Run solargraph stdio to start the server. The performance issues I encountered in my earlier experiments appear to be largely resolved here. I haven't benchmarked it, but its performance "feels" very close to the socket server.

I encourage client developers to clone/fork it and give it a try. Barring major bugs, I expect to publish it in gem version 0.23 or 0.24.

castwide avatar Jun 25 '18 06:06 castwide

The stdio branch is merged into master.

castwide avatar Jun 28 '18 13:06 castwide

thanks @castwide will the gemspec be updated and the update get published to rubygems in the next couple days?

megalithic avatar Jun 28 '18 19:06 megalithic

@megalithic I expect to publish it by Monday (July 2) at the latest.

castwide avatar Jun 29 '18 00:06 castwide

Published gem v0.23.0. Clients using stdio should run solargraph stdio.

castwide avatar Jul 02 '18 13:07 castwide

Guys, has anyone been able to get suggestions? Oni shows that Ruby has connected to language server; hovering over a class name shows me data. However, when I do [1,2,3]. , I do not get any suggestions.

  "language.ruby.languageServer.command": "solargraph",
  "language.ruby.languageServer.arguments": [
    "stdio",
  ],

It seems that the first time I open the file, I am able to get some completion on Arrays; this is what the developer tools console is showing:

Request completionItem/resolve

After the first use, I start getting Request textDocument/completion (which does not trigger anything)

zxiest avatar Jul 06 '18 13:07 zxiest

@zxiest Yes, I've got suggestions using LanguageClient-neovim with this setting:

let g:LanguageClient_serverCommands = {
            \ 'ruby': [ 'solargraph',  'stdio' ],
            \ }

I don't use Oni though, so can't help you there, sorry.

ghost avatar Jul 06 '18 14:07 ghost

@devinalvaro Can you post a full vimrc/init.vim? I can't get it to work in multiple async complete plugins.

bbtdev avatar Jul 07 '18 17:07 bbtdev

@bbtdev Sure, here it is https://pastebin.com/kUj551nv.

ghost avatar Jul 08 '18 01:07 ghost

Gem version 0.24.0 fixes a bug that affected some clients using the stdio transport. More information: https://github.com/castwide/solargraph/issues/79

castwide avatar Aug 07 '18 18:08 castwide

If anyone has any problems using the stdio transport, please open a new issue.

castwide avatar Oct 03 '18 11:10 castwide