class completion?

Coming from Delphi, there's a feature I always loved that they call "class completion". One of the things this does is look at the class you have your cursor in (either in the .hpp file or the .cpp file) and
a) create implementation for any methods declared in the class that are not yet implented (so if I had a class with "void foo();" in it in the .hpp file, it would create "void MyClass::foo() { (line break) }" in my .cpp file)
b) add method declarations to the class in the .hpp file that you have your cursor on in the .cpp file

Now, Delphi does this for ALL methods in the class. This is sometimes handy though it'd actually be handier if you could also tell it just to do it for the specific method declaration/implementation you have your cursor on.

Is this something clion does currently? If not, is it something it COULD do, or is there a technical limitation due to the architecture of c++ that prevents it?

3 comments
Comment actions Permalink

No sooner do I ask my question than I finally stumble upon the shortcut for it.

To implement a method while in the class header, it's the Implement Functions action (however you have that mapped).

To pull a definition out of the method implementation and put it in the class, it's the Show Intention Actions action.

0
Comment actions Permalink

Usually we use 'alt+enter' and then select actions in appeared tooltip.

0
Comment actions Permalink

Yep, that's the default keystroke for Show Intention Actions.

0

Please sign in to leave a comment.