Can I select the source for comments in hovers?

Answered

Regrettably, my organization doesn't use any kind of embedded documentation tool like Doxygen or clang-doc, so CLion can't render "cool" hovers for me. Of course, it can and does show whatever comments it finds above a method, and that could work fine - except for the following...

In my organization, we might have a class that's declared like this in a header file:

 

class A
{
public:
   // This method does some really super-important stuff that's really, like,
   // important.
   void a();
}

 

And it might have this in an implementation file:

 

//------------------------------------------------------------------------------
void A:a()
{
   // Haha - fooled you - it does nothing.
}

 

That "horizontal rule" above the method definition is typical for us, and it's a sensible way to visually organize the file.

However, if I'm looking at the code that calls A::a(), and I hover over the call, I don't get the information from the header file, I get the horizontal rule from the implementation, which isn't helpful.

I wish I could tell Clion, "When rendering hovers for methods, ignore the comment from the implementation file - instead, show me the comment from the header file." Or, maybe even better, perhaps I could choose which ones I want, and even show *both*.

It may be that this is already possible and I simply failed to find it, so I'm posting this here before embarrassing myself by submitting a feature request.

Does anyone here know anything about this?

0

Please sign in to leave a comment.