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. log_output.txt
          25 kB
        2. main.cpp
          0.3 kB
        3. Screen Shot 2022-03-23 at 8.47.13 PM.png
          Screen Shot 2022-03-23 at 8.47.13 PM.png
          108 kB
        4. Screen Shot 2022-03-23 at 8.47.38 PM.png
          Screen Shot 2022-03-23 at 8.47.38 PM.png
          116 kB
        5. Screen Shot 2022-03-30 at 8.02.13 AM.png
          Screen Shot 2022-03-30 at 8.02.13 AM.png
          101 kB
        6. Screenshot 2024-02-09 at 7.51.16 PM.png
          Screenshot 2024-02-09 at 7.51.16 PM.png
          71 kB
        7. Screenshot 2024-02-26 at 7.50.54 PM.png
          Screenshot 2024-02-26 at 7.50.54 PM.png
          80 kB
        8. tooltip1.png
          tooltip1.png
          119 kB
        9. tooltip2.png
          tooltip2.png
          109 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes