Is there a way to prevent Resharper from recommending specific headers for inclusion?

Hello,

I'm wondering if there's a way, via a pragma or such, to specify that a header is an internal header or such and thus should not be recommended for inclusion when searching for missing symbols.

This issue comes up when having a public header, say Library.h, which then itself includes LibraryDetail/Foo.h and LibraryDetail/Bar.h. Those headers are not intended to be included directly, and indeed cannot be (they're often #define-guarded), but if the symbol is in them, R# will recommend them for a missing symbol instead of the root header.

Ideally, I'd be able to specify something like #pragma resharper ForwardInclude "Library.h" or something in those internal/detail headers.

0
1 comment

Hello,

There's currently no way to do that.

IWYU pragmas use this syntax to indicate that another file should be included instead:

// IWYU pragma: private, include "Library.h"

This particular pragma is not supported yet, this is tracked in RSCPP-31375.

Thanks!

0

Please sign in to leave a comment.