Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] CDT Formatter Options Missing

Hello All,

I've been sent here from the freenode IRC channel by a helpful character by the nick of "paulweb515" who said people like Doug, Sergey and Andrew, etc are never in IRC.

I have an embedded project which people are wanting to commit to, which is a good thing TM, however my source is all hand formatted to perfection, and others are not so careful... I tried, about 3 or 4 years ago, to make a CDT formatter def that worked for me without introducing change that I didn't want, and failed horribly. I've just tried again, and come close to success, which is great! CDT rocks, btw! Much thanks for a top job! I've only played with one file so far, so other things may pop up, however my two complaints so far are these:

1) blank lines, no config for these at all, all block separation line chunks are reduced to one blank line. Not OK. I dug into the source just now and found that all of the blank line options are commented out in (at least) two files:

//    /**
//     * <pre>
//     * FORMATTER / Option to add blank lines before a new chunk
//     *     - option id:         "org.eclipse.cdt.core.
//     *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
//     *     - default:           "0"
//     * </pre>
//     */
//    public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk"; //$NON-NLS-1$


//    public int blank_lines_after_includes;
//    public int blank_lines_at_beginning_of_method_body;
//    public int blank_lines_before_field;
//    public int blank_lines_before_first_class_body_declaration;
//    public int blank_lines_before_includes;
//    public int blank_lines_before_member_type;
//    public int blank_lines_before_method;


Why? What would it take to bring these to life in the next version? :-)

2) I have a macro in an _expression_ that ends up with a space after it, and I can't find where to turn that off:

....vedVars->Lambda) / LAMBDA(1.0) ) * fixed.... << do not want/hate
....vedVars->Lambda) / LAMBDA(1.0)) * fixed.... << want

LAMBDA is a macro that scales the real world number for me. If I replace it with a literal such as 666 it does not insert a space. Likewise if I call a function in there (ending with a ')' also) it also does not insert a space. This seems like a bug to me. Thoughts?

Keep up the good work, one and all!



Back to the top