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

clangd grays out code after #endif that it shouldn't

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 6.0.0-rc1
    • Qt Creator 6.0.0-beta2
    • C/C++/Obj-C++ Support
    • None
    • Gentoo Linux AMD64 X11.
      KDE Plasma 5.23.2.
    • Linux/X11
    • 426fde79d6b920d4ccbc0c90659633e1c893e826 (qt-creator/qt-creator/6.0)

    Description

      Enabling clangd results in code appearing grayed out even after the `#endif`. This is how it appears without clangd:

       Enabling clangd results in:

      Whatever is responsible for this seems to break "code graying" completely. For example, try these reproduction steps:

      1. Open Creator.
      2. Create a new project.
      3. Select "Non-Qt Project" and "Plain C++ Application". I chose "qmake" as build system for simplicity.
      4. In `main.cpp`, go to the first line and add:
      #ifdef FOO
      #endif

      Now the code should look like this:

      #ifdef FOO
      #endif
      #include <iostream>

      Go to the first line again and insert a blank line. Creator gets bugged out by this. The wrong lines are being grayed out, and there's even an error message in there saying "Unterminated conditional directive."

      Attachments

        1. image-2021-10-29-08-45-08-621.png
          27 kB
          Nikos Chantziaras
        2. image-2021-10-29-08-45-22-179.png
          22 kB
          Nikos Chantziaras
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            realnc Nikos Chantziaras
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes