This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The method definition stub (signature, return type, stub for method body) in a .cpp-file should be generated automatically from the declaration in a .h-file. Example: I create a new class "Test" in Netbeans and get a Test.h and Test.cpp file. I then add the following two methods to Test.h: <Code> double computeSomething(double x, int y); void doSomething(std::string str) const; </Code> Because the actual implementation of these methods goes in the .cpp-file i then have to manually add the following to Test.cpp: <Code> double Test::computeSomething(double x, int y) { } void Test::doSomething(std::string str) const { } </Code> There is already a bit of code-completion offered (in the .cpp-file type "Test::", press CTRL+SPACE and choose the desired method), but this does not add the return type and the brackets for the function body (and does not place the cursor there). Also if i have declared 4 new methods in the .h-file i have to repeat this for every of these methos. I would be cool if you could use the code generator (ALT+INSERT) for this purpose like you can use it in header files to generate getter and setters. It should show a dialog for all the methods in the .h-file that are not yet defined in the .cpp-file, and should the create the definition stubs for the selected methods.
fixed, change sets: 91e43a9e3244 250dd278da7e
Integrated into 'main-silver', will be available in build *201309270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/9b6a04b6a0ec User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #213811 C++ Generate method definition stub from declaration - scratch (transplanted from 91e43a9e3244c1abda29d09152bbf6737bfa6d68)
additional fix: 0e8c61204c95
additional fix: 3609ba3906e2 see bug 236451 and: - decorate icon - fix destructor
additional fix: 7b707ae316e2 - replace selection
Note: Implemented CTRL+SPACE. IDE suggest implementing of class method if CTRL+SPACE was pressed: - inside file that already has at least one method definition - between method declarations
verified in NetBeans 7.4 patch1 build