suppose I have x.h

class X {
void f();
void g();

in x.cpp

#include "x.h"

can I just entry a command with "X" as a parameter, then I can get

void X::f() {}
void X::g() {}

https://github.com/tuhdo/semantic-refactor should do what you wish. It has some examples that show what it can do, and if I understood you correctly, Example 1 matches your use case. You might find the "How can I automatically insert a prototype in foo.h from foo.c?" thread helpful as well, it is very closely related.

| improve this answer | |
  • this is exactly what I want. thank you! – zhihuifan Jan 15 '19 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.