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

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.

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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