2

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() {}

1 Answer 1

1

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.

1
  • this is exactly what I want. thank you!
    – zhihuifan
    Commented Jan 15, 2019 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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