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 119330 - Ability to keep signatures + comments in sync in both .h and .c/.cc files
Summary: Ability to keep signatures + comments in sync in both .h and .c/.cc files
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vladimir Voskresensky
Depends on:
Blocks: 136314
  Show dependency tree
Reported: 2007-10-18 11:02 UTC by eskild
Modified: 2009-09-25 14:06 UTC (History)
0 users

See Also:
Exception Reporter:


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:


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

/* -----------------------------------------------------
 * 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