The C project I am working on has some special coding style rules that I couldn't find an option in CDT's coding style settings. For example,
1.
switch () {
__case xx: <two spaces for case>
____statements; <two more spaces for statements inside case>
break;
}
2.
RET_TYPE<new line after return type>
func_name ()<new line>{
....
}
3. different from function implementation, for declaration of functions, there should be no space after the function name before (
RET_TYPE<new line>
func_name();
These are the 3 important ones that I couldn't find in the CDT's Preference settings. So I am wondering whether there is an extension point for CDT's coding style component? and where can I start? Never wrote anything for Eclipse before.
Thanks,
you could extend the org.eclipse.cdt.core.formatter.CodeFormatter . source can be found in http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/ , which is probably the best documentation you'll find.
an example of this (now almost 6 years old) is available in a subversion repository at http://astyleclipse.svn.sourceforge.net/viewvc/astyleclipse/ .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With