Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-26021

Code model problems after first opening and restoring previous session

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • Qt Creator 6.0.0-beta1
    • C/C++/Obj-C++ Support
    • Gentoo (also observed on ArchLinux with older versions of Qt/QtC), Qt 5.12.2
    • Linux/X11

    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.

      Attachments

        Activity

          People

            kandeler Christian Kandeler
            nhourt Nathan Hourt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: