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 90106 - Code Template settings "cc" should be broken into "C and C++", "C" and "C++" settings
Summary: Code Template settings "cc" should be broken into "C and C++", "C" and "C++" ...
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-27 17:04 UTC by _ gordonp
Modified: 2007-08-23 10:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gordonp 2006-11-27 17:04:10 UTC
In Tools->Options, Editor node, Code Templates tab, the C/C++ entry under
Language is "cc". First off, shouldn't we have entries for both C and C++?
Next, shouldn't they be "C" and "C++"? The "cc" string doesn't seem very
user-friendly!
Comment 1 Vladimir Voskresensky 2006-11-27 17:28:00 UTC
this is NB problem. Languages are hardcoded in NB see
http://www.netbeans.org/issues/show_bug.cgi?id=89447

*** This issue has been marked as a duplicate of 79599 ***
Comment 2 _ gordonp 2006-11-29 15:23:51 UTC
Reopening with a modified summary. The original summary made it look like a
duplicate of 79599 but the description also stressed the importance of splitting
C and C++ into separate language settings. The new summary focuses on that.
I'll also add 79599 as a blocker to this IZ.
Comment 3 Vladimir Voskresensky 2006-11-29 17:10:38 UTC
Not everywhere we need splitting. Let's minimize this issue to Code Templates.
But in fact we need 3 settings:
"C and C++", "C" and "C++" parts.
"fori" for C++ should be like:
for (int i = 0; i < |; i++) {

}
and for C it should be:
int i;
for (i = 0; i < |; i++) {

} 

while "re" is the same for both and expands into "return"
So, 3 types of Options for 2 supported languages:
- C and C++ Common Options
- C specific Options (with inheritance from "C and C++" and possible overrides)
- C++ specific Options (with inheritance from "C and C++" and possible overrides) 
Comment 4 Vitezslav Stejskal 2006-11-29 22:07:30 UTC
I am not sure how to solve it and it probably won't be an easy fix. You
certainly could have two different mime types and provide a different set of
code templates for each of them, but the current implementation of Tools-Options
does not support any sort of inheritance of code templates between mime types.

Anyway, I am not actually sure that this is suitable for you, because then you
would need to treat C and C++ files as different mime types with all the
implications. You can't simply fork code templates and share the other settings.
Comment 5 _ gordonp 2006-11-29 22:22:22 UTC
C and C++ files are different mime types. But I'm not actuall sure which
of several sub-issues you're referring to. Are you saying you can't (easily)
split cc into C and C++? or are you saying you can't split it into the 3
groups Vladimir V suggested?

Personally, I'm more interested in splitting into C and C++ categories than
in having those 2 plus a compibed one.
Comment 6 Vladimir Voskresensky 2006-11-30 07:17:09 UTC
Gordon, I think we need consistency and do not break usability. 
In case of splitting on two, I think it is not usable to configure each time
twice font&colors.
Splitting on two only is possible on implementation level but needs a lot of
Copy&Paste, because settings are not sharable between mime types. 
Comment 7 Vladimir Voskresensky 2007-08-23 10:40:59 UTC
it was split on two (C, C++) and we decided it's OK