Eclipse Kepler Configuration
eclipse.buildId=4.3.0.M20130731-0800
eclipse.commands=-os
win32
-ws
win32
-arch
x86
org.eclipse.cdt (8.2.0.201306112328) "Eclipse C/C++ Development Tools"
*** Plug-in Registry:
org.eclipse.cdt (8.2.0.201306112328) "Eclipse C/C++ Development Tools" [Starting]
org.eclipse.cdt.core (5.5.0.201306112328) "C/C++ Development Tools Core" [Active]
org.eclipse.cdt.core.win32 (5.3.0.201306112328) "C/C++ Development Tools Core for Windows" [Resolved]
org.eclipse.cdt.core.win32.x86 (5.2.0.201306112328) "C/C++ Development Tools Core for Windows (x86)" [Resolved]
Background:
I have created a C/C++ Code Style Formatter Custom Profile based on the built-in
Whitesmiths profile.
I configured the custom profile to conform to our coding standard, using the preview
pane to verify the format. The preview pane is a great tool.
Next I configured the Editor Templates to use the formatter.
From Custom Formatter Profile (Braces tab):
switch (bar)
{
case 0:
++bar;
break;
case 1:
--bar;
default:
{
bar += bar;
break;
}
}
From Custom Formatter Profile (White Space tab):
switch (number)
{
case RED:
return GREEN;
case GREEN:
return BLUE;
case BLUE:
return RED;
default:
return BLACK;
}
while (condition)
{
}
do
{
}
while (condition);
From Templates Preview:
switch (${key}) {
case ${value}:
${line_selection}${cursor}
break;
default:
break;
}
do {
${line_selection}${cursor}
} while (${condition});
ISSUE:
Most of the supported templates are inserted a expected. I have found two templates
(switch/case, do/while) which do not conform to the configured formatter options
when auto-inserted.
I was able to find possibly related bug report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=246627
https://bugs.eclipse.org/bugs/show_bug.cgi?id=161024 (from 2006, subsequent reports marked a duplicate????!!!)
Inserted incorrect format:
switch (key)
{
case value:
break;
default:
break;
}
do
{
}while (condition);
Workaround:
I have disabled the "Use code formatter" option and updated each of the templates
to produce the desired results.
Am I missing something?
Thanks in advance for any response.