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.

Bug 271253 - enable "Implement body" of class method in header file as enabled in source file
Summary: enable "Implement body" of class method in header file as enabled in source file
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-09 08:52 UTC by mambu
Modified: 2017-08-09 13:06 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mambu 2017-08-09 08:52:10 UTC
Using CTRL+<space> in a source file (.cpp) suggests implementing methods that do not have an implementation.
It would be very useful to have the same for inline methods when CTRL+<space> is done in the header file, outside the class definition.

Example:

class A
{
public:
   void Set(int val);
};

*** Cursor here *** Hit CTRL+<space>

The first item should be something like "void Set(int val) - implement inline" and should generate the code below (with the correct syntax formatting, the one below is just an example) and place the cursor inside the body.

inline
void A::Set(int val)
{
***place cursor here***
}

Also, when a method is 
Many thanks.
Comment 1 Vladimir Voskresensky 2017-08-09 10:31:37 UTC
Hi, this works already exactly as you expect when you are in paired cpp file.
in completion list on top you will find 
"void A::Set - implement"

But I agree, it's worth to have it visible in header file below class as well.

FYI there is one more nice action as well:
if you have inlined method
class A
{
 void Set(int val) {
  // with body
 }

};

then in cpp file you can see in code completion "void A::Set - extract body"

P.S. Ctrl+Shift+A is shortcut to switch between source/header pair
Comment 2 mambu 2017-08-09 13:06:13 UTC
Thanks, I know already about those other features.
When the body is implemented in the header file, the "inline" keyword should be added.