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

已完成

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?

评论操作 固定链接

VS 2019 with ReSharper – highlighting works perfectly fine.

0
评论操作 固定链接

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
评论操作 固定链接

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
评论操作 固定链接

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

0
评论操作 固定链接

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
评论操作 固定链接

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
评论操作 固定链接

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

0
评论操作 固定链接

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

 
0

请先登录再写评论。