How to tame clang issues after upgrading to Qt Creator 7.0.2?
-
I have been using Qt Creator for several years. Recently I upgraded to the latest version, 7.0.2 and frankly for me it feels like the wheels have fallen off! I understand clang is doing more with this version by default, but I had enabled it previously without experiencing the issues I have now.
- My C++ code all seems to be treated like C so I have annoying decorations everywhere in my source telling me keywords like 'class' and 'public' are not valid.
- In many many files, my F2 functionality (follow symbol or open header) is broken.
- (unrelated to clang) With every file I open I have to choose the encoding before I'm able to edit the file. If I close that file and reopen I have to choose the encoding all over again. Why is this? I don't remember having to do this before.
If I disable clangd, the above issues go away but I lose the code completion feature that I've been enjoying all these years.
One clue I have is that now I can with each editor pane select 'clangd' or 'clangd for <myproject>'. When I choose 'clangd' I get all the annoying errors about e.g. class and public not being valid keywords. When I select 'clangd for <myproject>' I seemingly lose my F2 functionality and still get incorrect clang warnings, though not as many.
Is there a guide or some suggestions on how to tame these newfound problems? Overall it feels like a step backwards from the previous version I was using.
On a positive note, I really like the extra CMake features with this release!
Thanks,
Rich -
I have been using Qt Creator for several years. Recently I upgraded to the latest version, 7.0.2 and frankly for me it feels like the wheels have fallen off! I understand clang is doing more with this version by default, but I had enabled it previously without experiencing the issues I have now.
- My C++ code all seems to be treated like C so I have annoying decorations everywhere in my source telling me keywords like 'class' and 'public' are not valid.
- In many many files, my F2 functionality (follow symbol or open header) is broken.
- (unrelated to clang) With every file I open I have to choose the encoding before I'm able to edit the file. If I close that file and reopen I have to choose the encoding all over again. Why is this? I don't remember having to do this before.
If I disable clangd, the above issues go away but I lose the code completion feature that I've been enjoying all these years.
One clue I have is that now I can with each editor pane select 'clangd' or 'clangd for <myproject>'. When I choose 'clangd' I get all the annoying errors about e.g. class and public not being valid keywords. When I select 'clangd for <myproject>' I seemingly lose my F2 functionality and still get incorrect clang warnings, though not as many.
Is there a guide or some suggestions on how to tame these newfound problems? Overall it feels like a step backwards from the previous version I was using.
On a positive note, I really like the extra CMake features with this release!
Thanks,
Rich -
Also, I see now from this [1] that Qt Creator doesn't try to detect encodings if the file is not UTF-8 encoded. I'm not sure why this wasn't an issue for me before upgrading to 7.0.2, but I understand why it keeps pestering me now.
[1] https://doc.qt.io/qtcreator/creator-editor-options-text.html