Syntax highlighting doesn't work in templated functions and template class methods definitions Follow
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?
Please sign in to leave a comment.
VS 2019 with ReSharper – highlighting works perfectly fine.
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?
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).
Is it a CMake project? Are those *.ipp files included into any source files?
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.
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.
It turned out that the user faced https://youtrack.jetbrains.com/issue/CPP-19218 which was fixed in CLion 2020.2.
Updating to 2020.2 helped indeed. Thank you for the assistance.