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 262155 - Create .h with .c file automatically
Summary: Create .h with .c file automatically
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: All All
: P1 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
: 122352 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-19 21:32 UTC by antoniocs
Modified: 2016-05-24 10:37 UTC (History)
1 user (show)

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 antoniocs 2016-05-19 21:32:52 UTC
Please add an option to automatically create .h file when creating a .c (or .cpp) file. 
9 times out of 10 I will create .h right after creating a .c file, so it is extremely annoying to go back and "Create a .h" when netbeans could just create this automatically with the same name given to the .c file.

There was a ticket with this request but it is from 2007
https://netbeans.org/bugzilla/show_bug.cgi?id=122352
Comment 1 Vladimir Voskresensky 2016-05-20 08:14:09 UTC
You can use New Class as workaround.
Comment 2 antoniocs 2016-05-20 09:19:40 UTC
If you already have code that almost does this would this not be easy to add?

I can use your "work around" but now my c file will have the extension .C which obviously differs from the .c extension I get when I create a new C file and also I have class code which I have to delete.

Thanks again for you solution but can we please maybe add this as an option in future versions of netbeans?
Comment 3 Vladimir Voskresensky 2016-05-20 14:01:28 UTC
Sorry, I haven't checked that "c" is absent in extensions combobox for source file, so my workaround is not convenient.
Yes, sure, we can add extra template like 
New Source/Header
similar to New Class
Comment 4 antoniocs 2016-05-20 14:10:42 UTC
Thanks!
Comment 5 Alexander Simon 2016-05-24 10:33:53 UTC
Added new "C Source and Header File" template in change set:
http://hg.netbeans.org/cnd-main/rev/460c9a31f0ab
Comment 6 Alexander Simon 2016-05-24 10:37:08 UTC
*** Bug 122352 has been marked as a duplicate of this bug. ***