You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two textDocument/didChange events being sent in Goland #583
You mean that you have registered a language server with lsp4ij and you have this kind of lsp didChange notifications?
Correct. I am pasting stuff from the "Traces" view.
If it is that it is very strange. Could you tell me which ls you are starting and give me some explanation how to start it please.
Sorry, I am unable to share details about the language server I am using.
Here is something else I noticed.
In the initialize message from the client, I see { "rootUri": null, "workspaceFolders": [] } when I have GoLand opened to a project. The background is brown though which suggests to me the IDE has gotten into some strange state.
I think this is likely the root cause of the issue...? Probably? The IDE seems to know I have a file opened at the full path but also since it's "not really in a project" perhaps it cannot (or does not try to) do any path resolution and also seems to think I have a file opened "nowhere" and hence just has it at file:///?
I have never tested a language server with text full synchronization, perhaps there is a bug with this synch kind?
I changed the code to use TextDocumentSyncKind.Incremental (and I can see the value of 2 in the logs) and it still happens so we can probably rule that out. 👍
You mean that you have registered a language server with lsp4ij and you have this kind of lsp didChange notifications?
Correct. I am pasting stuff from the "Traces" view.
If it is that it is very strange. Could you tell me which ls you are starting and give me some explanation how to start it please.
Sorry, I am unable to share details about the language server I am using.
Here is something else I noticed.
In the initialize message from the client, I see { "rootUri": null, "workspaceFolders": [] } when I have GoLand opened to a project. The background is brown though which suggests to me the IDE has gotten into some strange state.
I think this is likely the root cause of the issue...? Probably? The IDE seems to know I have a file opened at the full path but also since it's "not really in a project"
If your file doesnt belong to a project I think yiu could have strange behaviour like you have since I have not tested this usecase.
I don't have any strange "brown background" in my Dockerfile or the files around it so I think the system recognizes the file as being "inside a project"...?
You can setup my Dockerfile language server with npm install and then npm run prepublishOnly. The language server is setup in GoLand as follows without anything for "Configuration".
Since the LSP logs are so big I have attached it instead of putting it directly into this comment. You can see the doubled textDocument/didOpen on lines 406 and 963 and the doubled textDocument/didChange on 12791 and 12816. Hope this helps!
My new theory is that it is related to textDocument/semanticTokens/full somehow. When I disable semantic highlighting support from the server's initialize response I cannot seem to get the issue to reproduce itself.
My new theory is that it is related to textDocument/semanticTokens/full somehow. When I disable semantic highlighting support from the server's initialize response I cannot seem to get the issue to reproduce itself.
@rcjsuen it is difficult for me to try to fix issues that we have not in our IJ Quarkus because my current goal is to release IJ Quarkus which requires some issue to implement like #570
If you have time to debug and better create a PR I will be happy to review it.
If you need some help with the code base or other thing dont hesitate to ask me.
My new theory is that it is related to textDocument/semanticTokens/full somehow. When I disable semantic highlighting support from the server's initialize response I cannot seem to get the issue to reproduce itself.
@rcjsuen it is difficult for me to try to fix issues that we have not in our IJ Quarkus because my current goal is to release IJ Quarkus which requires some issue to implement like #570
If you have time to debug and better create a PR I will be happy to review it.
If you need some help with the code base or other thing dont hesitate to ask me.
Have you the same problem with IJ Community?
As Goland is not free, it is difficult for me to test it.
My new theory is that it is related to textDocument/semanticTokens/full somehow. When I disable semantic highlighting support from the server's initialize response I cannot seem to get the issue to reproduce itself.
@rcjsuen it is difficult for me to try to fix issues that we have not in our IJ Quarkus because my current goal is to release IJ Quarkus which requires some issue to implement like #570
If you have time to debug and better create a PR I will be happy to review it.
If you need some help with the code base or other thing dont hesitate to ask me.
Have you the same problem with IJ Community?
As Goland is not free, it is difficult for me to test it.
Activity
angelozerr commentedon Oct 26, 2024
You mean that you have registered a language server with lsp4ij and you have this kind of lsp didChange notifications?
If it is that it is very strange. Could you tell me which ls you are starting and give me some explanation how to start it please.
Thanks
angelozerr commentedon Oct 26, 2024
I have never tested a language server with text full synchronization, perhaps there is a bug with this synch kind?
rcjsuen commentedon Oct 26, 2024
Correct. I am pasting stuff from the "Traces" view.
Sorry, I am unable to share details about the language server I am using.
Here is something else I noticed.
In the
initializemessage from the client, I see{ "rootUri": null, "workspaceFolders": [] }when I have GoLand opened to a project. The background is brown though which suggests to me the IDE has gotten into some strange state.I think this is likely the root cause of the issue...? Probably? The IDE seems to know I have a file opened at the full path but also since it's "not really in a project" perhaps it cannot (or does not try to) do any path resolution and also seems to think I have a file opened "nowhere" and hence just has it at
file:///?rcjsuen commentedon Oct 26, 2024
I changed the code to use
TextDocumentSyncKind.Incremental(and I can see the value of2in the logs) and it still happens so we can probably rule that out. 👍angelozerr commentedon Oct 26, 2024
If your file doesnt belong to a project I think yiu could have strange behaviour like you have since I have not tested this usecase.
rcjsuen commentedon Oct 27, 2024
@angelozerr I was able to reproduce the problem with my open source language server with GoLand opened to the moby/buildkit repository.
I don't have any strange "brown background" in my
Dockerfileor the files around it so I think the system recognizes the file as being "inside a project"...?You can setup my Dockerfile language server with
npm installand thennpm run prepublishOnly. The language server is setup in GoLand as follows without anything for "Configuration".Since the LSP logs are so big I have attached it instead of putting it directly into this comment. You can see the doubled
textDocument/didOpenon lines 406 and 963 and the doubledtextDocument/didChangeon 12791 and 12816. Hope this helps!redhat-lsp4ij-issue583.txt
rcjsuen commentedon Oct 27, 2024
My new theory is that it is related to
textDocument/semanticTokens/fullsomehow. When I disable semantic highlighting support from the server'sinitializeresponse I cannot seem to get the issue to reproduce itself.angelozerr commentedon Oct 27, 2024
@rcjsuen it is difficult for me to try to fix issues that we have not in our IJ Quarkus because my current goal is to release IJ Quarkus which requires some issue to implement like #570
If you have time to debug and better create a PR I will be happy to review it.
If you need some help with the code base or other thing dont hesitate to ask me.
angelozerr commentedon Nov 3, 2024
Have you the same problem with IJ Community?
As Goland is not free, it is difficult for me to test it.
angelozerr commentedon Nov 3, 2024
@rcjsuen it would be nice if you could debug lsp4ij and set a breakpoint at https://github.com/redhat-developer/lsp4ij/blob/main/src%2Fmain%2Fjava%2Fcom%2Fredhat%2Fdevtools%2Flsp4ij%2FConnectDocumentToLanguageServerSetupParticipant.java#L57 . My first feeling is that in goland this fileOpened is called twice, but perhaps I am wrong.
rcjsuen commentedon Nov 5, 2024
From a quick test just now, I was unable to reproduce it with IntelliJ IDEA 2024.2.4 (Build #IC-242.23726.103).
angelozerr commentedon Nov 5, 2024
OK so it seems the problem comes from with goland.
[-]Two `textDocument/didChange` events being sent[/-][+]Two `textDocument/didChange` events being sent in Goland[/+]fix: Two textDocument/didChange events being sent in Goland
angelozerr commentedon Nov 20, 2024
@rcjsuen I close the issue since you cannot reproduce it. Please reopen if youhave again the problem.
rcjsuen commentedon Nov 20, 2024
@angelozerr I am okay with that decision. I think we need to understand the exact nuance of how a JetBrains IDE operates.
angelozerr commentedon Nov 20, 2024
I agree with you. I dont like issues which are fixed but without understand.
We will see if you can reproduce it.