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

CLONE - Syntax highlighting doesn't work when the code is inside a #if <expr> block.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • Qt Creator 3.4.0
    • Qt Creator 3.3.2, Qt Creator 3.4.2, Qt Creator 3.5.1
    • C/C++/Obj-C++ Support
    • None

    Description

      QtCreator enter into a syntax highlight limbo mode when the code is inside a #if <expr> preprocessor block.

      e.g.:

      #include <cstdio>
      
      #define ENABLE_HIGHLIGHT_LIMBO(EXPR) (EXPR)
      #if ENABLE_HIGHLIGHT_LIMBO(1)
      
      using namespace std;
      
      class Foo {
      public:
          virtual void foo(int a) {
              printf("%s : %d\n", __func__, a);
          }
      };
      
      int main() {
          Foo f;
          f.foo(__LINE__);
      }
      #endif
      
      

      If you comment the #if line will will see the "std" and "Foo" purple and the foo() on foo(_LINE_) italic for being a virtual call, if you leave it as is all this will be on pure black, with no syntax highlight helper :-/

      This issue affect all hackers working on WebKit with QtCreator.

      Attachments

        1. Capture.PNG
          Capture.PNG
          107 kB
        2. Capture2.PNG
          Capture2.PNG
          108 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            TonyMay Anthony May
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes