-
Notifications
You must be signed in to change notification settings - Fork 71
SourceKit Language Server stops response everytime after seconds of use #646
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
Comments
In addition, after it gets responsive, I change LSP settings, press OK to restart the language server, on the output window for Swift, it shows as:
(I restarted language server at 11:04:53) |
Can you report this in the https://github.com/apple/sourcekit-lsp repo. This is most likely an issue with sourcekit-lsp itself. |
The timeout issue appears to be an issue with VSCode itself. Restarting an LSP server on Windows doesn't register it has killed the original process. So I have to catch the timeout and assume it has killed the process. |
Would you be able to verify if these issues are resolved when using swift 5.8. I have another very similar issue which is resolved by using swift 5.8. I realise this is not a solution but it allows us to narrow down where the issue is coming from. By the way I added this swiftlang/sourcekit-lsp#982 |
Tried with Swift 5.8.1, everything works fine.
|
Thanks that narrows it down. Let's see if the sourcekit-lsp guys come up with anything. |
I have the same problem here VSCode 1.84.2 with Swift 5.9.1 on Windows 11. The moment I type Foundation. or WinSDK. , LSP Server take full CPU usage, issuing the command to restart LSP Server don't resolve, LSP Server constantly unresponsive. |
Good news from Alex Hoppen I confirm the fix is working with current main dev snapshot (Swift 5.11). Thanks Swift Team ! |
I wasn't sure if those changes had made it into a snapshot, obviously they have now. That's great news. |
As this is fixed and been cherry-picked for latest 5.9. It isn't part of a release yet it will be soon so I'm going to close this |
Describe the bug
Everytime I open a Swift code file, vscode-swift start running, after a few seconds of typing codes, the SourceKit Language Server won't response anymore. Only kill the sourcekit-lsp.exe with Task Manager, change LSP settings to restart the language server or restart VSCode can fix it for a moment, then it get unresponsive again.
Even during the period it runs normally, I often feel it laggy, which feels like it got unresponsive and recovered by itself after one or two seconds, but finally it will get completely unresponsive.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Work normally just like language servers for other languages
Environment
swift --version
): Swift version 5.9.1 (swift-5.9.1-RELEASE) Target: x86_64-unknown-windows-msvcAdditional context

I set "swift.sourcekit-lsp.trace.server" to "messages", here's a screenshot of the situation
The text was updated successfully, but these errors were encountered: