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

Code navigation jumps to wrong file of same base name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.12.3
    • C/C++/Obj-C++ Support
    • None
    • Linux/X11

    Description

       In brief, when I ctrl+left-click on a function declaration, it jumps to function definition in a wrong file with same base name, class name and function name, whereas the jump target file is out of current project.

      My project have this kind of directory layout:

      • root
        • ProductA
          • CMakeLists.txt
          • foo.h
          • foo.cpp
        • ProductB
          • CMakeLists.txt
          • foo.h
          • foo.cpp

      Files "foo.h" and "foo.cpp" in both project have function with same signature.

      If I have open history for both projects, then "Follow symbol under cursor" in a function declaration in ProductB's foo.h, it will jump to ProductA's foo.cpp.

      I also tried rename ProductA folder to something else, then re-run cmake for ProductB. Interestingly it sticks to jump to nonexisting ProductA's foo.cpp and failed.

      It seems the code model is keeping a global cache somewhere, but indexing symbols only using source file's base name?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kandeler Christian Kandeler
              jiandingzhe Xi Yang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes