Search code examples
c++qt-creatorclangd

Clangd is disabled at every launch by Qt Creator


Been using QtCreator for a few years, everything was great.

Recently I changed my main dev laptop, and now at every single startup I keep getting this message:

"The use of clangd for the C/C++ code model was disabled, because it is likely that its memory requirements would be higher than your system can handle."

My system specs are fine for clangd, I keep pressing "enable anyway" every single time, and no crashes or freezes occur ever. (so, the model works fine). But Creator keeps running this check and disabling clangd on my machine, it is very annoying!

The question is: is there any way to disable this specific check & message at every startup? (I haven't been able to find anything specific on the qt forums or google search.)

Qt Creator version 13.0.2, same problem both on MacOs and Ubuntu.

P.S. Apparently, from reading some more qt forum posts, the intended behavior is to disable the check after the user clicks "Enable anyway" for the first time? Possibly this is a bug in my case? (that the message keeps popping up at every launch)

Is there a config file or something I could edit to fix this?


Solution

  • Per Qt forum https://forum.qt.io/topic/158615/creator-memory-requirement-for-enabling-clangd-code-model the (current) code is looking for 12GB free RAM to avoid this message. Do you really have 12GB free on your Ubuntu/MacOS? Seems excessive to me, as I can run with Use clangd checked with only 4GB/2GB free, but there you are, and obviously it will depend on code size.

    You can get rid of the message. Edit QtCreator.ini file (e.g. Ubuntu in ~/.config/QtProject/) to include

    [ClangdSettings]
    diagnosticConfigId=Builtin.BuildSystem
    checkedHardware=true  
    

    I think the checkedHardware=true suppresses future checks/complaints.

    I have raised a Qt bug report at https://bugreports.qt.io/browse/QTCREATORBUG-31541. Over time we will see if maybe the Qt devs alter this or perhaps make the "Enable anyway" button disable future checks.