Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 7.0.0
-
None
-
Kubuntu 21.10 x86-64. QtCreator 7.0.1 build 681 from revision 06703e17d4. ffmpeg 4.4 or 5.0.
-
-
0cb569a39b (qt-creator/qt-creator/7.0) 0cb569a39b (qt-creator/qt-creator/master) 0cb569a39b (qt-creator/qt-creator/qds-3.3) 0cb569a39b (qt-creator/tqtc-qt-creator/7.0)
Description
In my CMake project, QtCreator doesn't highlight code in some files, other than:
- Preprocessor keywords
- String literals
- C++ keywords
- Comments
All other text is displayed black, as if not recognized. This applies to the whole file that is affected, while code coloring may work for other files in the same project, even the same CMake target.
In the files that are affected, code navigation (e.g. follow to symbol definition) does work. Also, moving the cursor at a word does highlight the same word elsewhere in the editor. No code model errors are reported, all include files are resolved, and the project compiles successfully.
The problem seems to affect files that are including ffmpeg headers, but that is not the definitive feature. I have some files that include ffmpeg headers that are affected and others that are not affected.
I have attached a test project that reproduces the problem. The project relies on pkg-config, which is standard on most Linux systems. You will need to have ffmpeg headers installed to configure the project (libavcodec-dev and libavutil-dev packages on Debian-based systems). After opening the project, configure it and open libav_decoder.h or libav_decoder.cpp in the editor. Code coloring may appear briefly and then disappear.
This only reproduces with clangd enabled.
Attachments
For Gerrit Dashboard: QTCREATORBUG-27384 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
406222,2 | ClangCodeModel: Fix check for AST nodes from included files | 7.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |