Open mrglavas opened 9 months ago
Opened and linked https://github.com/redhat-developer/lsp4ij/issues/139 to this issue.
In the case of the diagnostic not appearing the diagnostic participant is not called. Also no microprofile/java/diagnostics message is sent from the language server.
On VS Code the two projectLabels requests have complete responses:
On IntelliJ one of them is blank and the other is populated:
"No result returned" may mean the message request was cancelled.
"No result returned" may mean the message request was cancelled.
Do you see in the LSP console a cancel trace like:
[Trace - 08:53:15] Sending notification '$/cancelRequest'
Params: {
"id": "3"
}
No, the traces look just like the IntelliJ traces (Liberty, Quarkus) seen in the original message above. But in the console log there is
Ok thanks for your information. I will try to investigate the problem when I will have some time (I'm busy for the moment with https://github.com/redhat-developer/lsp4ij/pull/137)
@turkeylurkey to attempt a temporary solution to mitigate this problem. When releasing, we should document this problem on the known problems wiki page and provide a link in the release notes.
It seems that you have fixed the issue, but I'm not sure that it is the correct fix.
If you wait for the timout that you have defined and you retry to open it, I think you will have the same problem.
I suspect that it is a problem with a cancel of projectLabels, but I need to find time to investgate the problem.
I think Paul was just trying to reduce the probability that the user could hit this issue while this is still being investigated for the correct fix.
Re-opening since the fix that went in is intended to mitigate the problem, not fully resolve it.
I have tested it using Latest LSP4IJ ( 0.0.2 ). When I open a file containing an error, diagnostics are published. I tried opening and closing ServiceLiveHealthCheck class with the @Liveness annotation removed repeatedly. When I open the file, diagnostics were displayed correctly.
@anusreelakshmi934 With the temporary solution that @turkeylurkey introduced it became harder to reproduce this issue. I believe he changed the timeout on shutting down the language server to 10 hours. We suspected the issue was related to the language server start-up. If you want to verify if the underlying problem is still there, you could undo the timeout change: https://github.com/OpenLiberty/liberty-tools-intellij/pull/662 in a local build and then check again.
I reverted the timeout code and checked for the diagnostics. I was able to get the diagnostics.
I was opening and closing all the files and I ran across the situation below, the diagnostics did not appear.
It was not easy to reproduce. It took about 30 repetitions of opening some files, closing them all, restarting the Jakarta and MP language servers, opening and closing more files and several times restarting the IDE.
It looks like it can happen but rarely.
After further testing I was able to reproduce the error of not getting the diagnostic. In InvalidWebFilter (src/test/resources/projects/maven/jakarta-sample/src/main/java/io/openliberty/sample/jakarta/servlet/InvalidWebFilter.java) file, diagnostics were not dispalyed upon opening and closing the file repeatedly. Again if i close this file and open it back again i am getting the diagnostic.
In some cases i am getting the diagnostic but not the quickfixes.
When I repeatedly opened and closed a java file, I noticed that the LSP4MP diagnostics were missing in some cases. However, if I closed and reopened the file again, the diagnostics would appear.
version of LTI - 24.0.9 - candidate driver version of LSP4IJ - 0.4.1-20240906-013124 version of IntelliJ - 2024.1.6 file - Java file version of LSP4MP - 0.12.0
https://github.com/user-attachments/assets/653f0db6-6825-49d2-ade8-4546892ffff6
I see this about 10% of the time in testing 24.0.9 snapshot using the process documented.
While testing with LSP4IJ version 0.5.0, I opened a file containing an error that is @Liveness
removed, diagnostics were published. However, when I opened and closed the file repeatedly, the diagnostics were sometimes not published.
I have observed this issue with Liberty Tools for IntelliJ (useLSP4IJ1201 branch) and Quarkus Tools v1.30.1. Occasionally when I open a file containing an error, no diagnostics are published. This doesn't seem to happen often but I've been able to reproduce it. To reproduce this, I open and close one file (specifically the
ServiceLiveHealthCheck
class with the@Liveness
annotation removed from a MicroProfile starter project) repeatedly, allowing the MicroProfile language server to shutdown completely before opening the file again. Eventually when I open the file, no diagnostics will be displayed. I'm guessing there must be a timing issue and something with the language server/client isn't initialized around the time diagnostics would have been collected and published.Screenshot of IntelliJ with the Liberty Tools plug-in installed:
Screenshot of IntelliJ with the Quarkus Tools plug-in installed: