-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Lsp restart command spawn multiple procces for every call #3968
Comments
Interesting, this must be a Windows specific bug. This did not happen during testing on Linux. |
It's not clear to me where the old process is dropped in #3435. |
This was discussed in the PR: #3435 (comment) It gets killed when the client gets dropped, which should happen here. |
cc @mangas |
For the moment I take the old client returned by let NewClientResult(client, incoming) = start_client(id, language_config, config)?;
self.incoming.push(UnboundedReceiverStream::new(incoming));
let (_, old_client) = entry.insert((id, client.clone()));
tokio::spawn(async move {
if let Err(e) = old_client.shutdown_and_exit().await {
log::error!("failed shutdown language server: {}", e);
return;
}
});
Ok(Some(client)) |
According to the
|
Nice find. We should probably add a Lines 394 to 400 in 98dd9c4
So it looks like normally, the process should exit on its own after these two requests. However, it's conspicuously absent from the spec what should happen if the |
After looking at a lot of my code and searching for the problem, I overlooked that the branch from which I use the helix executable had another branch merged into it, specifically #2653, which I believe keeps the old_client active. By testing the clean master branch, I was able to verify that the old process is definitely removed. 😕😄 |
Summary
The new lsp restart command does not shut down the current server, so one process is left hanging, and a new one is executed.
Opening the editor for the first time: 3 processes
Running lsp-restart for the first time: 6 processes
Running lsp-restart for the second time: 9 processes
Reproduction Steps
Helix log
not relevant
Platform
Windows
Terminal Emulator
wezterm 20220908-191626-25cd05a8
Helix Version
helix 22.08.1 (e8f0886)
The text was updated successfully, but these errors were encountered: