FS#75712 - [qtcreator] Language model perpetually shows errors and eventually be disabled when clangd crashes

Attached to Project: Arch Linux
Opened by Aaron Barany (akb825) - Saturday, 27 August 2022, 21:46 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 07 September 2022, 05:53 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The language model supported by clangd fails in two major ways if clangd crashes, which can be somewhat common depending on editor settings:
1. Errors show in the IDE and never get cleared out.
2. Many features end up breaking as the document is edited.
3. If clangd crashes more than 5 times when the project is opened, it will disable the clangd language model and use a fallback with limited features.

Additional info:
* package version(s): 8.0.0, 8.0.1
* upstream bug report: https://bugreports.qt.io/browse/QTCREATORBUG-27596

The following patches can be applied to gracefully recover when clangd crashes:
* Fix for corrupted document contents being sent to clangd after restart (will be available in 8.0.2): https://codereview.qt-project.org/c/qt-creator/qt-creator/+/427448
* Reset crash counter for disabling clangd after a timer (on master, will be available in 9.0): https://codereview.qt-project.org/c/qt-creator/qt-creator/+/425985
* Increase restart threshold before disabling clangd (up for review on master, should be available in 9.0): https://codereview.qt-project.org/c/qt-creator/qt-creator/+/429219

Steps to reproduce:
See reproduction steps in upstream bug report here: https://bugreports.qt.io/browse/QTCREATORBUG-27596?focusedCommentId=673920&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-673920
This task depends upon

Closed by  Antonio Rojas (arojas)
Wednesday, 07 September 2022, 05:53 GMT
Reason for closing:  Fixed
Additional comments about closing:  qtcreator 8.0.1-2
Comment by Aaron Barany (akb825) - Monday, 29 August 2022, 07:24 GMT
We're still going through some back and forth for the third patch to tune the restart limits, but hopefully we'll find a common ground that works well in real-world situations within a few days.
Comment by Aaron Barany (akb825) - Friday, 02 September 2022, 10:13 GMT
The third review has been adjusted to their liking and merged in, so these patches should be good to go.

Just a heads up and reminder from the original report, the first change will be available in 8.0.2, but the other two are on the master branch for the 9.0 release so they'll still be needed for future releases on the 8.0 series.
Comment by Aaron Barany (akb825) - Wednesday, 07 September 2022, 02:18 GMT
Thanks, I can verify the updated package you pushed over the weekend has the patches and works as expected.

Loading...