-
Notifications
You must be signed in to change notification settings - Fork 32
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
inconsistent textDocument/completion results #28
Comments
I suspect this is because of something not working with incremental document sync. I.e. the editor and LSP server could be out of sync if incremental sync doesn't work right and diffs are not integrated properly or in wrong order from th editor Do you get spurious validation errors too on large buffers? I do sometimes (on emacs at least) -- if confirmed that would indicate that we need to work on document syncing. In the meantime I could provide an option to disable incremental sync and we could check if that helps |
Based on logs I added earlier I guess that client does not wait till textDocument/didChange is fully processed and emits textDocument/completion that works with old file version. Its just 1 millisecond away:
My naive approach would be to try to delay processing of |
I think I will have to pimp the request scheduler a bit so that parallel r/w and r/o requests are not run. This was a bit of an optimization which bite me in the butt. I expected for the editor to serialize r/o requests to be run AFTER editor receives response from pending r/w request(s) but now it is obvious this is a responsibility of the server. can you try changing this line in Server.fs: "textDocument/completion" , handleTextDocumentCompletion |> withReadOnlyScope |> requestHandling to "textDocument/completion" , handleTextDocumentCompletion |> withReadWriteScope |> requestHandling ? ^^^ this should enforce proper serialization for until I fix the locking/serialization mechanism |
Yey, "textDocument/completion" with |
@vytautassurvila could you check if your problems are fixed with 21601a8? I have forced for |
Thanks, it solves issue with test project! Tomorrow I will be able to test more extensively with real projects. |
ok, 0.4.3 has been released, closing |
On vscode I get inconsistent completion results. I depends on how auto-completion was invoked - by trigger character or invoked via shortcut. Wild guess would be that autocompletion is done based on code that was before typing trigger character (trigger character is not accounted).
Sample file I tested on
When I type
this.
I get autocompletion with itemsas
,is
,switch
,with
. Note that these options are valid forthis
(with space after it). Messages that are being sent to csharp-ls:But if I close autocompletion and trigger it via shortcut then I get correct items
Equals
,Setup
,ToString
and others. csharp-ls messages:Note that it's not always reproducible. I guess it somehow depends on file size too. As when working with big files it happens more often than with this sample program.
The question is can you reproduce that on other clients? If needed I probably could implement some hack/fix on vscode language client to wait for textDocument/didChange response (maybe event add some delay) and only then emit textDocument/completion
The text was updated successfully, but these errors were encountered: