Qt Creator V6.0.2 Suddenly stopped syntax highlighting and code completion.
-
Hello,
I'm on QtCreator v6.0.2 and it suddenly stopped syntax highlighting and doing code completion.
As you can see it doesn't highlight anything besides the most basic keywords.
I've noticed that when I've added this file to the project at first it had correct syntax highlighting, and there was a popup message at the top of the screen that "This file isn't a part of a project" however after a few seconds when QtCreator figured out that it is indeed a part of a project, the pop up disappeared and with it the syntax highlighting.
I looked in the Generic highlighter section and the folder it pointed to was empty. I tried to 'redownload definitions' and it says everything is fine. I pointed it to a fallback dir located in
C:\Qt\Tools\QtCreator\share\qtcreator\generic-highlighter
which is not empty, but it made no difference.Any idea how to resolve this issue would be greatly appreciated.
EDIT: Turning off the
Clang Code Model
plugin seem to solve the issue. Though I'm not sure why that is. -
@Curtwagner1984 I can confirm the same issue on my side, had to turn of clang code model as well. I also noticed that the hotkey for forcing the code completion popup also doesn't work and regular freezes of the whole Creator.
Sadly the old code model doesn't support syntax past c++11, which is irritating, but still preferable over the mess QtC6.0.2 clang code model implementation is.
I ignored rule number one, never use a
x.0
version 😮💨 -
Note that Qt Creator moved to a different versioning scheme, and since Qt Creator 5 we only have
x.0
versions.Qt Creator 6.0.2 is the latest and greatest Qt Creator 6.
Regarding the loss of highlighting, most probably libclang can't handle the source code and errors out.
See https://wiki.qt.io/Qt_Creator_Clang_Code_Model about how to debug why libclang bailed out.
With Qt Creator 7 we're moving to
clangd
which will be a different way of having syntax highlighting. -
@cristian-adam said in Qt Creator V6.0.2 Suddenly stopped syntax highlighting and code completion.:
With Qt Creator 7 we're moving to clangd which will be a different way of having syntax highlighting.
QtC7 didn't fix the issue of whole regular QtC freezing, when using the clang code model. It's slightly less regular, bit still just barely useable, compared to 5.0.3 that is still running on my Mac