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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 3.4.0
    • Qt Creator 2.7.2, Qt Creator 2.8.0, Qt Creator 3.0.0-rc1
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            hugopl Hugo Parente Lima
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes