Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
None
-
Qt Creator 6.0.0-beta1
-
Gentoo (also observed on ArchLinux with older versions of Qt/QtC), Qt 5.12.2
Description
I've been seeing this issue for many versions now, but finally decided to report it. I am seeing this on master (app version 5.82.0, commit 0eb2d62b0a). I am using the Clang code model, and I am working with CMake projects.
When I first open Qt Creator, and on the welcome screen, I select the default session which is to restore the previous session, it opens my previous project and open files; however, the code model is out of whack initially. It might just be missing the include paths; I'm not entirely certain, but it puts the error icons on many of my #include statements saying the header isn't found, and then of course the code model fails to process most of my code because without those headers, the types aren't defined.
The issue is easy enough to work around: I close the open file. If some other file was in the stack and becomes active, the code model chews on it for a moment and then cranks up the syntax highlighting and all is well. If I re-open the original file again, it chews and works as normal. So it's only for file(s) put on-screen by that "load previous session."
The whole thing feels like a race condition, like the code model is getting ahead of itself trying to parse the files at session load, before the include paths are loaded or some such, and any time you trigger it afterwards, the include paths are fed in correctly and it all works... but that's just conjecture from someone who doesn't know how QtCreator works, so I'll stop trying to talk about things I don't understand =)
Let me know if you have any questions or experiments I should run.