castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 23 forks source link

Mapping workspace hangs up 750/833 [with stdio transport] #220

Closed NuriYuri closed 3 years ago

NuriYuri commented 3 years ago

SolarGraph version: 0.41.1
Problem: The extension hangs up with the notification Mapping workspace: 750/833 files
Ruby Language Server Output:

Solargraph is listening on stdio PID=4368
warning: parser/current is loading parser/ruby30, which recognizes
warning: 3.0.0-compliant syntax, but you are running 3.0.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

Workspace with the error: https://gitlab.com/pokemonsdk/pokemonsdk/-/tree/development/scripts (Note: VSCode always open from the scripts folder!)

I've tried to run the command: solargraph scan -v
The first time it crashed at a script so I made a commit to fix the issue and ran the command again, the command completed but for some reason the mapping does not work when I reopen VSCode :\ image

castwide commented 3 years ago

I tested opening the scripts folder using Ruby 3.0.0. Workspace mapping completed successfully. LSP features like completion and hover worked as expected.

NuriYuri commented 3 years ago

Hello I probably forgot to say I'm running under Windows 10.

Just in case here's my ruby -v output: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [i386-mingw32]

NuriYuri commented 3 years ago

I just tried changing from transport = stdio to transport = socket. It works perfectly with sockets so I guess it's a bug with the stdio transport ^^

(I use stdio because the connection was very unstable with sockets for some reasons, idk if it improved for now).

castwide commented 3 years ago

Thanks for catching that. I confirmed that it hangs using the stdio transport, most likely due to erroneous data being sent to the stdout stream. I'll look into it.

castwide commented 3 years ago

Solargraph gem v0.42.4 includes an update that suppresses some instances of erroneous YARD output.

NuriYuri commented 3 years ago

It's working!

Thanks a lot :D