Syntax highlighting doesn't work in templated functions and template class methods definitions

Completed

I have a little project in which I defined templated class in *.hpp file. Because there are plenty of member methods, i decided to define them in separate *.ipp files which invoke the header.

Unfortunately, syntax highlighting only works for template header and function prototype (see screenshot). Anything inside curly braces is not fully highlighted (variables, objects are not; only strings, chars are). The situation occurs not only for templated class methods definitions, but also for non-member templated functions.

In VS 2019 with ReSharper everything is highlighted perfectly fine. What's wrong with CLion?

8 comments
Comment actions Permalink

VS 2019 with ReSharper – highlighting works perfectly fine.

0
Comment actions Permalink

Hello!

Do I understand correctly that syntax highlighting doesn't work in *.ipp files? There was an issue with *.ipp files (which aren't fully supported actually - CPP-4406) - https://youtrack.jetbrains.com/issue/CPP-14130, but it was fixed in CLion 2019.1. What CLion version do you use?

0
Comment actions Permalink

I'm using CLion 2020.1 and the problem occurs in *.ipp files, inside templates. Basic keywords, template parameters, function return type and parameters are highlighted, but variables etc. are not (like on screenshot attached).

0
Comment actions Permalink

Is it a CMake project? Are those *.ipp files included into any source files?

0
Comment actions Permalink

Yes, it's a CMake project. A CMakeLists.txt contains every cpp, hpp and ipp file in project.

*.ipp files include class hpp file. And those *.ipp files are included in "main.hpp" header which is further used in my source cpp file.

Even when including .ipps directly in .cpp, the problem still occurs.

 
0
Comment actions Permalink

So far I can't reproduce the issue on the simplest project. Please send the project on which the issue can be reproduced to clion-support at jetbrains.com.

0
Comment actions Permalink

It turned out that the user faced https://youtrack.jetbrains.com/issue/CPP-19218 which was fixed in CLion 2020.2.

0
Comment actions Permalink

Updating to 2020.2 helped indeed. Thank you for the assistance.

 
0

Please sign in to leave a comment.