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
Syntax Highlighting breaks since Jetbrains version 2024.2.1 on error #780
Hello.
I'm developing a plugin for the QML Language Server for Android Studio. I get syntax highlighting out of the box using LSP4IJ as shown below.
However, starting from Android Studio Ladybug (Jetbrains 2024.2.1), the syntax highlighting breaks whenever there is an error in the code. It returns back to normal if the error is fixed.
Error in code before Android Studio Ladybug:
Error in code after Android Studio Ladybug:
Tested this bug on regular IntelliJ IDEA and was able to reproduce starting with 2024.2.1 and above. It is configured like this:
Errors in Trace Logs: [Trace - 12:58:37] Received response 'textDocument/semanticTokens/full - (20)' in 1ms. No response returned. Error: { "code": -32800, "message": "Cannot proceed: current QML document is invalid!" }
Enable verbose tracing and compare the requests for both versions. There's likely a difference somewhere that might explain the problem, eg, newer version of Android sending a different payload to your LS
@angelozerr Thanks for replying.
Expected result would be that when there is an error in the code, the syntax highlighting keeps working as it was doing before version 2024.2.1 using the same Language Server binary
@angelozerr Thanks for replying.
Expected result would be that when there is an error in the code, the syntax highlighting keeps working as it was doing before version 2024.2.1 using the same Language Server binary
You mean that with the same language servers and the same LSP4IJ version if the ql document have some errors it continue to have syntax coloration with IJ < 2024.1 and no syntzx coloration with IJ >= 2024.1 ?
If it that could you like @fbricon suggested to share your lsp traces with IJ < 2024.1 and IJ >= 2024.1 in order to compare them.
@fbricon Thanks for the suggestion. @angelozerr Yes that's exactly it with a small correction. The syntax coloration works with IJ < 2024.2 and no coloration with IJ >= 2024.2
I fear that I cannot do something since with the same version of LSP4IJ and the same lsp request (your 2 attached trace files are the same) the behaviour is different with the 2 versions of IJ.
To understand the problem we should debug IJ himself but I will not have time to do that.
The issue should be fixed on your language server side to support invalid document like other language servers do.
Hey @angelozerr , thanks for letting me know. I just tested out with the release of 0.12, but unfortunately, the issue seems to be still there. Will inform here if I can get it working anytime in the future.
This is just a hypothesis, but I think in the newer version of IJ, it just clears out the LSP data and sends out request again to the language server every time we edit the file, and that language server is currently not good at recovering from errors in file
Hey @angelozerr , sorry for not replying earlier. But we managed to add recovery functionality to our language server and I think this issue can be closed now.
Activity
angelozerr commentedon Jan 29, 2025
This error comes from the language server. Which fixes do you expect?
fbricon commentedon Jan 29, 2025
Enable verbose tracing and compare the requests for both versions. There's likely a difference somewhere that might explain the problem, eg, newer version of Android sending a different payload to your LS
su-nikunj commentedon Jan 29, 2025
@angelozerr Thanks for replying.
Expected result would be that when there is an error in the code, the syntax highlighting keeps working as it was doing before version 2024.2.1 using the same Language Server binary
angelozerr commentedon Jan 29, 2025
You mean that with the same language servers and the same LSP4IJ version if the ql document have some errors it continue to have syntax coloration with IJ < 2024.1 and no syntzx coloration with IJ >= 2024.1 ?
If it that could you like @fbricon suggested to share your lsp traces with IJ < 2024.1 and IJ >= 2024.1 in order to compare them.
su-nikunj commentedon Jan 29, 2025
@fbricon Thanks for the suggestion.
@angelozerr Yes that's exactly it with a small correction. The syntax coloration works with IJ < 2024.2 and no coloration with IJ >= 2024.2
IJ 2024.1.2
koala.txt
IJ 2024.2.2
ladybug.txt
angelozerr commentedon Feb 4, 2025
@nikunjarora12345 could you please explain me how to download / install your language server. I have no time to read your doc, sorry.
su-nikunj commentedon Feb 4, 2025
@angelozerr no worries. The language server comes bundled with Qt installation which you can download from here: https://www.qt.io/download-qt-installer-oss (You'll need a Qt account)
In the installer, you can choose the latest Qt version (6.8.2) and it should install the language server in C:\Qt\6.8.2\gcc_64\bin\qmlls (Windows) or ~/Qt/6.8.2/gcc_64/bin/qmlls (Linux and something similar on Mac)
angelozerr commentedon Feb 5, 2025
I fear that I cannot do something since with the same version of LSP4IJ and the same lsp request (your 2 attached trace files are the same) the behaviour is different with the 2 versions of IJ.
To understand the problem we should debug IJ himself but I will not have time to do that.
The issue should be fixed on your language server side to support invalid document like other language servers do.
su-nikunj commentedon Feb 7, 2025
@angelozerr no worries. Thanks for the replies. I'll also try from my end to see if I can find the discrepancy between the IJ versions.
angelozerr commentedon Feb 7, 2025
If you have time to debug IJ and find a fix, any contribution are welcome!
angelozerr commentedon Mar 31, 2025
@su-nikunj we have improved semantic highlight in 0.12.0, could yiu please install nighty and tell me if it is better? Thanks
su-nikunj commentedon Apr 2, 2025
Hey @angelozerr , thanks for letting me know. I just tested out with the release of 0.12, but unfortunately, the issue seems to be still there. Will inform here if I can get it working anytime in the future.
angelozerr commentedon Apr 2, 2025
Ok thanks for your feedback.
To be honnest with you, I don't understand why it is worked before?
su-nikunj commentedon Apr 2, 2025
This is just a hypothesis, but I think in the newer version of IJ, it just clears out the LSP data and sends out request again to the language server every time we edit the file, and that language server is currently not good at recovering from errors in file
angelozerr commentedon Apr 2, 2025
If it that, I fear that LSP4IJ cannot do something -(
angelozerr commentedon Oct 19, 2026
@su-nikunj have you still this issue?
su-nikunj commentedon Oct 20, 2026
Hey @angelozerr , sorry for not replying earlier. But we managed to add recovery functionality to our language server and I think this issue can be closed now.
fix: a failed or cancelled semantic tokens request keeps the semantic…
fix: a failed or cancelled semantic tokens request keeps the semantic…