Closed flobzex closed 10 months ago
Can confirm that. But for some reason it only happens with the installed extension, not if you open the vscode-meson repo in Codium and then want to debug it. this.ls.stop()
here is async, so we should probably await it.
Furthermore I've seen that VSCode doesn't even send the shutdown/exit notifications to the server, so the issue is client-side
@JCWasmx86 can you submit a PR to make it await?
I investigated a little. Apparently in src/extension.ts
there must be a exports.deactivate
function so that the extension can receive the termination callback. There's only the activate one there.
Thank you!
Are you interested in submitting a PR? Otherwise, I can look into it when I have time.
I'm going to try creating a patch and will create a PR if it works (I'm not familiar with the codebase yet).
This would be my first contribution.
Works for me! Might try looking at what the clangd vscode extension does in its deactivate
Good day, peeps! I've been testing ways to fix this bug and I found a few things.
Requesting the language server to terminate via the deactivate function works, but still, sometimes a new instance of the process is created. I suspect this behavior has to do with the current design, where the variable LanguageServerClient.ls
is set to null after the LSP is stopped, and whenever the LSP needs to start, a new instance is created. That mixed with the concurrency of the async functions may be the cause the cause of this problem.
I'll keep on investigating this issue and see if I can find a fix.
Best regards
Hello! I couldn't find a solution, but I found out that the problem is really in VSCode. It does call the dispose function, with or without the deactivate function, because LanguageClient
is a disposable. The very source of the problem seems to be in this.ls.stop()
, which succeeds, but the process doesn't get killed, even with await
.
I haven't been able to reproduce this recently for what its worth. Someone else is probably gonna have to debug it.
I haven't been able to reproduce this recently for what its worth. Someone else is probably gonna have to debug it.
I can debug it, since at least #194 "works" (doesn't close) on my setup 🤔
When VS Code is started or reloaded, the extension downloads and runs the LSP. However, it always starts at least two instances of
Swift-MesonLSP
. Besides, the processes are not cleaned when VS Code is closed or restarted, which results in various orphaned instances of the LSP running.System info: