Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 119330 - Ability to keep signatures + comments in sync in both .h and .c/.cc files
Ability to keep signatures + comments in sync in both .h and .c/.cc files
Status: NEW
Product: cnd
Classification: Unclassified
Component: Editor
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Vladimir Voskresensky
issues@cnd
:
Depends on:
Blocks: 136314
  Show dependency treegraph
 
Reported: 2007-10-18 11:02 UTC by eskild
Modified: 2009-09-25 14:06 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eskild 2007-10-18 11:02:20 UTC
I know, I know, this is probably a bit insane, but here goes:

It would be tremendously useful if the editor/code-model knew how to keep function signatures and documentation blocks
in sync across the .h and .c/.cc files. For example, in the company where I work we have a coding standard that says,
among a lot of other things, that a) each function should have a header of a specific formant, and b) the header should
be present   both for definition and declaration. During development, where things may change, it's a nuisance to keep
the comments in sync, along with the signatures. Imagine this:

foo.h:

/* -----------------------------------------------------
 * Frobnigaze badushie blabberdegook if whigraakk != 3.
 * -------------------------------------------------- */
void frob(int whigraakk);

foo.c:
/* -----------------------------------------------------
 * Frobnigaze badushie blabberdegook if whigraakk != 3.
 * -------------------------------------------------- */
void frob(int whigraakk)
{ ... }

Now, if someone sane decided that the comment and parameter names were, perhaps, a bit unreadable, then that person
would have "a lot" of work to do -- edit the header, then cut-and-paste to the .c and finally rename the var all the
places it's used in the func.

So my suggestion is as follows:

1. A way to automatically link the signature of a function (or struct/class for that matter) with the immediately
preceding comment, so the two can be treated as a single entity by Netbeans (this should be an option, of course).

2. When the cursor is positioned inside a such comment block or function signature, a right-click option or hotkey that
says "Sync with definition" or "Sync with declaration", depending on where we are.

It would be HUGELY useful. It's always a major pain when documentation is out-of-date between .h and .c/.cc files.

I can get some of the way with macros, but it's not really elegant IMHO. Plus, with this, the "Show documentation"
function (Ctrl-Shift-Space) would work too.
Comment 1 Vladimir Voskresensky 2009-09-25 14:06:11 UTC
consider for the next release due to lack of resources


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo