Resharper for "Headeronly"

I'm using ReSharper with Visual Studio on a CMake (open folder) project. My project contains multiple targets (several static libraries and one executable).

Issue: ReSharper doesn't seem to index header-only files that aren't included in any .cpp files. These header files are properly added to their respective targets using target_sources in CMake.

For example, I have header-only utility classes that are properly part of my build targets but aren't currently referenced in any .cpp files. ReSharper doesn't provide any IntelliSense / formatting or navigation features for these files. Not even correct syntax colouring.

Questions:

  • Is this the intended behavior of ReSharper with CMake projects?
  • Am I missing a configuration step to make ReSharper properly index all target sources?
  • Has anyone else encountered this issue and found a solution?
0
2 comments

Hello,

R# uses Visual Studio's API to read project information in CMake projects. This API returns compilation properties for each .cpp file that is included into the CMake build. So from this point of view, we can't distinguish a header that is included into a CMake target from any other header that is not used at all.

R# doesn't index standalone headers in CMake projects because some projects include huge header-only libraries as subfolders, and we don't want to index them when most of the files are not used in the project. This is currently not configurable.

I think we can try parsing standalone headers when they get opened in the editor, but still not index them on project open. Filed https://youtrack.jetbrains.com/issue/RSCPP-36659/.

Thanks!

0

Please sign in to leave a comment.