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

"new" keyword is not always syntax-highlighted correctly w/ clangd

    XMLWordPrintable

Details

    • macOS

    Description

      The "new" keyword in a C++ project does not always get color-coded correctly, and appears to randomly jump between the color of a keyword and a non-keyword, depending on what's around it with no rhyme or reason. 

      This is with clangd enabled.  If I disable clangd it works as before (Qt 6, 5, etc all color-coded the "new" keyword as a keyword always consistently). This is on macOS (I haven't tried Windows or Linux).

      Description of problem: In Qt 7 w/ clangd, if I type "new" it first starts off colored as a keyword, and then sometimes (but not always), depending on context, randomly jumps to non-keyword color coding.

      See attached screenshots and sample program. 

      main.cpp

      Attachments

        1. main.cpp
          0.3 kB
        2. Screen Shot 2022-03-23 at 8.47.13 PM.png
          Screen Shot 2022-03-23 at 8.47.13 PM.png
          108 kB
        3. Screen Shot 2022-03-23 at 8.47.38 PM.png
          Screen Shot 2022-03-23 at 8.47.38 PM.png
          116 kB
        4. Screen Shot 2022-03-30 at 8.02.13 AM.png
          Screen Shot 2022-03-30 at 8.02.13 AM.png
          101 kB
        5. tooltip1.png
          tooltip1.png
          119 kB
        6. tooltip2.png
          tooltip2.png
          109 kB

        Activity

          People

            kandeler Christian Kandeler
            cculianu calin culianu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: