Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Clangd header-insertion
Forum Updated to NodeBB v4.3 + New Features

Clangd header-insertion

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 3 Posters 832 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brynjolf
    wrote on last edited by
    #1

    I am not using Qt-Creator for my development, I am using CMake with Qt 6.6.0, and clangd as a language server.

    My issue is that clangd's header-insertion feature is automatically including the header files, and not their macros. E.g. when I add gDebug() to a file, the header that is automatically inserted is <qlogging.h> rather than <QDebug>.

    Also, another symptom is: when declaring the Q_OBJECT macro in a header, clangd will automatically insert <qobjectmacros.h>, which is unnecessary.

    I have tried using both my /usr/bin/clangd and the clangd inside the Qt distribution, and both have to same result.

    I haven't done any Qt-specific configuration for clangd, so perhaps I have not set up my lsp properly. Any advice is warmly welcomed.

    F DolfostD 2 Replies Last reply
    1
    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
    • B Brynjolf

      I am not using Qt-Creator for my development, I am using CMake with Qt 6.6.0, and clangd as a language server.

      My issue is that clangd's header-insertion feature is automatically including the header files, and not their macros. E.g. when I add gDebug() to a file, the header that is automatically inserted is <qlogging.h> rather than <QDebug>.

      Also, another symptom is: when declaring the Q_OBJECT macro in a header, clangd will automatically insert <qobjectmacros.h>, which is unnecessary.

      I have tried using both my /usr/bin/clangd and the clangd inside the Qt distribution, and both have to same result.

      I haven't done any Qt-specific configuration for clangd, so perhaps I have not set up my lsp properly. Any advice is warmly welcomed.

      F Offline
      F Offline
      Febbe
      wrote on last edited by
      #2

      @Brynjolf fixed via https://bugreports.qt.io/browse/QTBUG-119505 and part of upcoming QT 6.7.

      1 Reply Last reply
      0
      • B Brynjolf

        I am not using Qt-Creator for my development, I am using CMake with Qt 6.6.0, and clangd as a language server.

        My issue is that clangd's header-insertion feature is automatically including the header files, and not their macros. E.g. when I add gDebug() to a file, the header that is automatically inserted is <qlogging.h> rather than <QDebug>.

        Also, another symptom is: when declaring the Q_OBJECT macro in a header, clangd will automatically insert <qobjectmacros.h>, which is unnecessary.

        I have tried using both my /usr/bin/clangd and the clangd inside the Qt distribution, and both have to same result.

        I haven't done any Qt-specific configuration for clangd, so perhaps I have not set up my lsp properly. Any advice is warmly welcomed.

        DolfostD Offline
        DolfostD Offline
        Dolfost
        wrote on last edited by
        #3

        @Brynjolf Have You figured something out?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved