-
Notifications
You must be signed in to change notification settings - Fork 170
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
Multiple ruby-lsp processes running at the same time #2681
Comments
Thanks for the report, but we'd need some more information to investigate. If you restart your machine, and keep an eye on the processes while doing things, then you can try find the steps for a reproducible case. |
I believe this is the same issue as #1865, which we never managed to reproduce in order to fix. Can you share the logs printed to the It seems like there's some sort of race condition when launching the language server. Is your Rails app at the root of the directory where you open VS Code? |
i'm facing same issue. (I have 8 repositories with multi-root workspace) Followings are the experiments I did: 'killall bundle' -> this kills all lsp processes (confirmed by using top) Experiment 1
Logs
Experiment 2
Logs
Experiment 3opening any rb file while all lsp servers are killed -> Error: Connection is disposed. (Expected) Logs
Experiment 4At this point, I think the number of lsp processes are nearly deterministic. (16-17) So I tried to find where number 17 comes from. For this, I removed and re-installed the extension.
Experiment 5Excluding 'class-rails' from the workspace prevents automatic lsp startup during vscode launch(reload). Logs
Experiment 6Include Experiment 7
Experiment 8I tried change my 'code-workspace' file. Especially the position of 'class-rails' repository. Under this configuration, 17 lsp servers are started. "folders": [
{
"path": "../repo/cds"
},
{
"path": "../repo/codle"
},
{
"path": "../repo/class-rails"
},
{
"path": "../repo/admin-react"
},
{
"path": "../repo/jlext"
},
{
"path": "../repo/user"
},
{
"path": "../repo/admin-rails"
},
{
"path": "../repo/entry-ts"
}
], On the other hand, with this, only 1 lsp server is started. It almost saved 10GB of RAM... "folders": [
{
"path": "../repo/class-rails"
},
{
"path": "../repo/cds"
},
{
"path": "../repo/codle"
},
{
"path": "../repo/admin-react"
},
{
"path": "../repo/jlext"
},
{
"path": "../repo/user"
},
{
"path": "../repo/admin-rails"
},
{
"path": "../repo/entry-ts"
}
], |
@a3626a I've edited your post to hide the logs by default since they are very long. |
it looks like you deleted most of my experiment results, including restarting my Windows system. I will double-check it later soon. (Add) I have re-organized my comment. And I found an work-around for this problem. Check the above comment. |
I still can't seem to reproduce the issue. By best bet is that some other VS Code extension is triggering a bunch of This theory also matches the fact that you're seeing workspaces activated even without any files opened, which is not the intended behaviour of the Ruby LSP at all. We only eagerly activate the first workspace and all others are lazily activated (only get launched once you open a Ruby file that belongs to it). If we're seeing secondary workspaces being eagerly activated, then something must be firing the I hope #2693 will fix this. |
If @adamzapasnik can try disable all extensions other than Ruby LSP then we should be able to verify this. |
I have found it. It was "Github Pull Requests" Extension in my case. |
Great, thank you. I recently found another issue with that extension: #2649 |
If that's the case, then I really believe that #2693 will fix this. |
sorry I wasn't much of help, this week didn't have time to dedicate to this 😔 , it's been fixed for me too 🙏 must have been a different extension though, cause I don't have "Github Pull Requests" installed. @a3626a thanks a lot for chiming in, you saved me ;) 🙏 and @andyw8 @vinistock for responsiveness and a very fast fix :) |
@adamzapasnik #2693 has been merged, but not yet released. |
We have released it https://github.com/Shopify/ruby-lsp/releases/tag/vscode-ruby-lsp-v0.8.4. |
My bad, I was looking at the date of the most recent gem release instead of the extension release. |
I have tested v0.8.4 with Github Pull Requests extension. With this setup, ruby-lsp launches on reload, but only 1 process, perfect. Thank you. |
Description
I have multiple lsp processes running at the same time and killing my battery and freezing everything on updates? I'm just running vscode with a rails project opened, nothing unusual 🤷
Might be related to #2446? But don't have time to investigate more, feel free to close if it's a duplicated issue.
Ruby LSP Information
User
Reproduction steps
Not sure?
The text was updated successfully, but these errors were encountered: