Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator's extebded complex type syntax highlighting is messy
Forum Updated to NodeBB v4.3 + New Features

QtCreator's extebded complex type syntax highlighting is messy

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 3 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Stanislav SilnickiS Offline
    Stanislav SilnickiS Offline
    Stanislav Silnicki
    wrote on last edited by
    #1

    Hi All!

    may be it would be a good idea to fix complex type highlighting in C environment?

    If I try to declare non-default 'float complex' type, QtCreator immediately starts taking followed variable name as an extra symbol, claiming its as 'unexpected token' and blooding the code with its perfectly shaped katana-blade ;)
    It does consider simple 'complex' declaration as accepted one (line 133) though...

    0_1520730375135_Screenshot from 2018-03-11 03-59-23.png

    'float complex' is a valid declaration, and it is really wanted when coding for embedded ARM processors as soon as default double type takes huge time to compute.

    Stan

    aha_1980A 1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      Hi,

      There's nothing anyone on these forums can do officially. You would have much better luck submitting a bug or feature request. This is a user based forum none of the Qt devs usually hang out here.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • Stanislav SilnickiS Stanislav Silnicki

        Hi All!

        may be it would be a good idea to fix complex type highlighting in C environment?

        If I try to declare non-default 'float complex' type, QtCreator immediately starts taking followed variable name as an extra symbol, claiming its as 'unexpected token' and blooding the code with its perfectly shaped katana-blade ;)
        It does consider simple 'complex' declaration as accepted one (line 133) though...

        0_1520730375135_Screenshot from 2018-03-11 03-59-23.png

        'float complex' is a valid declaration, and it is really wanted when coding for embedded ARM processors as soon as default double type takes huge time to compute.

        Stan

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Stanislav-Silnicki

        If you enable the Clang Code Model (Help -> About Plugins) the highlighting works fine and no syntax error is shown. There won't be anymore fixes to the builtin code model, so you don't need to file a bugreport.

        PS: you have a type in the thread title, please fix it so it can be found again later.

        Qt has to stay free or it will die.

        Stanislav SilnickiS 1 Reply Last reply
        1
        • aha_1980A aha_1980

          @Stanislav-Silnicki

          If you enable the Clang Code Model (Help -> About Plugins) the highlighting works fine and no syntax error is shown. There won't be anymore fixes to the builtin code model, so you don't need to file a bugreport.

          PS: you have a type in the thread title, please fix it so it can be found again later.

          Stanislav SilnickiS Offline
          Stanislav SilnickiS Offline
          Stanislav Silnicki
          wrote on last edited by
          #4

          @aha_1980 Hi! thank you for a clue! Indeed, it doesn't work well...

          Header file immediately becomes a pile of red roses...

          0_1520817292523_Screenshot from 2018-03-12 04-13-49.png

          And vendor supplied file as well....

          0_1520817525115_Screenshot from 2018-03-12 04-18-00.png

          aha_1980A 1 Reply Last reply
          0
          • Stanislav SilnickiS Stanislav Silnicki

            @aha_1980 Hi! thank you for a clue! Indeed, it doesn't work well...

            Header file immediately becomes a pile of red roses...

            0_1520817292523_Screenshot from 2018-03-12 04-13-49.png

            And vendor supplied file as well....

            0_1520817525115_Screenshot from 2018-03-12 04-18-00.png

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Stanislav-Silnicki

            As Clang is a compiler, it is also pendantic ;)

            As it seems you are cross-compiling, Clang has problems to find or to understand diverse header files. You will have to make sure the headers are properly parsed, e.g. by injecting some DEFINES into the code model. How to do that depends on your project - I've done it a lot for the Generic Projects to overcome problems like yours.

            However, if your include files uses language extensions, that may not be enough.

            Qt has to stay free or it will die.

            Stanislav SilnickiS 1 Reply Last reply
            0
            • aha_1980A aha_1980

              @Stanislav-Silnicki

              As Clang is a compiler, it is also pendantic ;)

              As it seems you are cross-compiling, Clang has problems to find or to understand diverse header files. You will have to make sure the headers are properly parsed, e.g. by injecting some DEFINES into the code model. How to do that depends on your project - I've done it a lot for the Generic Projects to overcome problems like yours.

              However, if your include files uses language extensions, that may not be enough.

              Stanislav SilnickiS Offline
              Stanislav SilnickiS Offline
              Stanislav Silnicki
              wrote on last edited by
              #6

              @aha_1980 I use arm-none-eabi-49... as a compiler's part and Qbs as build engine. Of course, I can feed a lot of defines withing qbs's project file, but it will not help to beautify editor's frame. So, I'm afraid, Clang's code model (at least with Qbs on-board) can't fix.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved