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

Clang include completion duplicates

    XMLWordPrintable

Details

    • Linux/X11

    Description

      Hello,

      The cmake project that I'm working on has a symlink to a directory with header files. In the end both paths get their way into include directories list which results in include completion showing doubled results coming from both the directory and the symlink to it. See the attachments.

      Expected behaviour is to show only one path.

       

      spdlog used as an example:

      /home/dantez/projects/spdlog/include
      mylinkinclude -> /home/dantez/projects/spdlog/include
      

      CMakeLists.txt:

      target_include_directories(spdlog PUBLIC
       "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
       "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/mylinkinclude>")
      

       
      The quick fix I wrote solved the issue though filtering is applied on every completion - which is failproof to changes to the link itself. I assume this is why cmake can't filter it out.

      https://gist.github.com/DanielChabrowski/24b6481cade657f4af7f0c615d1a9be2

      If this is enough I can issue a MR. Cheers.

      Attachments

        1. doubleddir.png
          doubleddir.png
          7 kB
        2. doubledfiles.png
          doubledfiles.png
          13 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            danielchabrowski Daniel Chabrowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes