-
Notifications
You must be signed in to change notification settings - Fork 280
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
Sourcekit-LSP stops working after a cancel of completion #1890
Comments
Synced to Apple’s issue tracker as rdar://141508699 |
Thanks for the report, @angelozerr. Which version of SourceKit-LSP are you using? If you're using a Swift development snapshot, there was an issue with cancellation that sound similar and which I fixed recently (#1857). If that's not it, could you run |
First here my simple test. I have in my project just this file and I'm trying to open completion after var name = ""
name. If I open completion slowly, it works great. If I write quickly some character after Here the generated file with This diagnose is very strange because we have the impression that everything is working pretty well, but it is not true. Here the LSP traces that I have in my IntelliJ LSP console: If you see my LSP trace, completion is working upon the (8) completion request which report a cancel:
And after that if I reopen completion, there are none LSP response of textDocument/completion although in the diagnose there are some LSP response? After debugging the LSP client, it seems that SourceKit-LSP doesn't write any response in the input stream. We can send request but there are no answer from the SourceKit-LSP language server although the SourceKit-LSP process is alive? The diagnose displays a response of the 9 request:
and in my LSP trace you can see just:
without response. Please note that you can see a cancel of request 9:
but this cancel occurs when completion is closed (I'm waiting for some times before closing it). |
Oh, I suppose the cancellation of the code completion request somehow gets the code completion session that SourceKit-LSP maintains with sourcekitd in an invalid state. I can debug this in the new year. |
Thanks so much @ahoppen ! |
Swift version
Last
Platform
Windows 11
Editor
LSP4IJ (Free LSP support for IJ)
Description
Hi,
I contact you because I'm trying to consume Sourcekit-LSP with LSP4IJ a free LSP support for IntelliJ.
If you want to test it, please read https://github.com/redhat-developer/lsp4ij/blob/main/docs/user-defined-ls/sourcekit-lsp.md after installing LSP4IJ
All features are working pretty well (hover, highlight, semantic tokens, call hierarchy, etc) except completion. Completion is working pretty well if you type characters in the editor slowly, but as soon as you are typing quickly in the editor, the Sourcekit-LSP breaks all LSP features (no highlight, no hover, no completion, etc).
Please note that all language servers that I have tested like Go, Rust, etc are working pretty well. First I though it was a problem with didChange, but I send the same didChange notification than vscode.
After spending a lot of time to discover the usecase which causes the problem, I have noticed that this problem occurs when completion is cancelled.
As soon as I am typing quickly in the editor, it send cancelRequest for completion and after that the Sourcekit-LSP is down (it gives me some response but with cancel and not only for completion, for highlight, hover etc).
It have the impression that I have the similar problem than Emacs-LSP emacs-lsp/lsp-mode#3028 but I find it is very strange to kill the Sourcekit-LSP when LSP client cancels the completion.
I have the impression that I don't send the proper triggerChars for completion after completion is cancelled. Perhaps I need to set triggerChars to 3 when completion is canceled but I have no problem with other LSP language servers?
I wanted just to share my problem.
Any help are welcome! Thanks!
Steps to Reproduce
No response
Logging
No response
The text was updated successfully, but these errors were encountered: