mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Formatter improvements and fixes
Content assist: Add support for context information (parameter hints)
This commit is contained in:
parent
24f59a092f
commit
dc1b1b8a53
17 changed files with 592 additions and 371 deletions
|
@ -566,15 +566,15 @@ public class DefaultCodeFormatterConstants {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation"; //$NON-NLS-1$
|
public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to set the continuation indentation inside array initializer
|
* FORMATTER / Option to set the continuation indentation inside array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer"
|
||||||
// * - possible values: "<n>", where n is zero or a positive integer
|
* - possible values: "<n>", where n is zero or a positive integer
|
||||||
// * - default: "2"
|
* - default: "2"
|
||||||
// * </pre>
|
* </pre>
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer"; //$NON-NLS-1$
|
||||||
// /**
|
// /**
|
||||||
// * <pre>
|
// * <pre>
|
||||||
// * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header
|
// * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header
|
||||||
|
@ -733,17 +733,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_annotation";//$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_annotation";//$NON-NLS-1$
|
||||||
//
|
//
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a new line after the opening brace in an array initializer
|
* FORMATTER / Option to insert a new line after the opening brace in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_opening_brace_in_array_initializer";//$NON-NLS-1$
|
public static final String FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_opening_brace_in_array_initializer";//$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -767,17 +767,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_catch_in_try_statement"; //$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_catch_in_try_statement"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a new line before the closing brace in an array initializer
|
* FORMATTER / Option to insert a new line before the closing brace in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_closing_brace_in_array_initializer";//$NON-NLS-1$
|
public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_closing_brace_in_array_initializer";//$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* FORMATTER / Option to insert a new line before the else keyword in if statement
|
* FORMATTER / Option to insert a new line before the else keyword in if statement
|
||||||
|
@ -1020,17 +1020,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_annotation"; //$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_annotation"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a space after the comma in an array initializer
|
* FORMATTER / Option to insert a space after the comma in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: INSERT
|
* - default: INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_array_initializer"; //$NON-NLS-1$
|
||||||
// /**
|
// /**
|
||||||
// * <pre>
|
// * <pre>
|
||||||
// * FORMATTER / Option to insert a space after the comma in the parameters of a constructor declaration
|
// * FORMATTER / Option to insert a space after the comma in the parameters of a constructor declaration
|
||||||
|
@ -1251,17 +1251,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_parameters";//$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_parameters";//$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a space after the opening brace in an array initializer
|
* FORMATTER / Option to insert a space after the opening brace in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_brace_in_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_brace_in_array_initializer"; //$NON-NLS-1$
|
||||||
// /**
|
// /**
|
||||||
// * <pre>
|
// * <pre>
|
||||||
// * FORMATTER / Option to insert a space after the opening bracket inside an array allocation expression
|
// * FORMATTER / Option to insert a space after the opening bracket inside an array allocation expression
|
||||||
|
@ -1537,17 +1537,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_parameters"; //$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_parameters"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a space before the closing brace in an array initializer
|
* FORMATTER / Option to insert a space before the closing brace in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_brace_in_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_brace_in_array_initializer"; //$NON-NLS-1$
|
||||||
// /**
|
// /**
|
||||||
// * <pre>
|
// * <pre>
|
||||||
// * FORMATTER / Option to insert a space before the closing bracket in an array allocation expression
|
// * FORMATTER / Option to insert a space before the closing bracket in an array allocation expression
|
||||||
|
@ -1768,17 +1768,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_annotation"; //$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_annotation"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a space before comma in an array initializer
|
* FORMATTER / Option to insert a space before comma in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_array_initializer"; //$NON-NLS-1$
|
||||||
// /**
|
// /**
|
||||||
// * <pre>
|
// * <pre>
|
||||||
// * FORMATTER / Option to insert a space before comma in the parameters of a constructor declaration
|
// * FORMATTER / Option to insert a space before comma in the parameters of a constructor declaration
|
||||||
|
@ -2021,17 +2021,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"; //$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a space before the opening brace in an array initializer
|
* FORMATTER / Option to insert a space before the opening brace in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_array_initializer"; //$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* FORMATTER / Option to insert a space before the opening brace in a block
|
* FORMATTER / Option to insert a space before the opening brace in a block
|
||||||
|
@ -2375,17 +2375,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
// * @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
// */
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_brackets_in_array_type_reference"; //$NON-NLS-1$
|
// public static final String FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_brackets_in_array_type_reference"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to insert a space between empty braces in an array initializer
|
* FORMATTER / Option to insert a space between empty braces in an array initializer
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
|
* - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
|
||||||
// * - possible values: { INSERT, DO_NOT_INSERT }
|
* - possible values: { INSERT, DO_NOT_INSERT }
|
||||||
// * - default: DO_NOT_INSERT
|
* - default: DO_NOT_INSERT
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see CCorePlugin#INSERT
|
* @see CCorePlugin#INSERT
|
||||||
// * @see CCorePlugin#DO_NOT_INSERT
|
* @see CCorePlugin#DO_NOT_INSERT
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_braces_in_array_initializer"; //$NON-NLS-1$
|
public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_braces_in_array_initializer"; //$NON-NLS-1$
|
||||||
// /**
|
// /**
|
||||||
// * <pre>
|
// * <pre>
|
||||||
// * FORMATTER / Option to insert a space between empty brackets in an array allocation expression
|
// * FORMATTER / Option to insert a space between empty brackets in an array allocation expression
|
||||||
|
@ -2463,17 +2463,17 @@ public class DefaultCodeFormatterConstants {
|
||||||
* @see #FALSE
|
* @see #FALSE
|
||||||
*/
|
*/
|
||||||
public static final String FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_else_statement_on_same_line"; //$NON-NLS-1$
|
public static final String FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_else_statement_on_same_line"; //$NON-NLS-1$
|
||||||
// /**
|
/**
|
||||||
// * <pre>
|
* <pre>
|
||||||
// * FORMATTER / Option to keep empty array initializer one one line
|
* FORMATTER / Option to keep empty array initializer one one line
|
||||||
// * - option id: "org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line"
|
* - option id: "org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line"
|
||||||
// * - possible values: { TRUE, FALSE }
|
* - possible values: { TRUE, FALSE }
|
||||||
// * - default: FALSE
|
* - default: FALSE
|
||||||
// * </pre>
|
* </pre>
|
||||||
// * @see #TRUE
|
* @see #TRUE
|
||||||
// * @see #FALSE
|
* @see #FALSE
|
||||||
// */
|
*/
|
||||||
// public static final String FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_empty_array_initializer_on_one_line"; //$NON-NLS-1$
|
public static final String FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_empty_array_initializer_on_one_line"; //$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* FORMATTER / Option to keep guardian clause on one line
|
* FORMATTER / Option to keep guardian clause on one line
|
||||||
|
|
|
@ -21,6 +21,8 @@ import java.util.Stack;
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBreakStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTBreakStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCaseStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCaseStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
||||||
|
@ -45,7 +47,10 @@ import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerExpression;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerList;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTLabelStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTLabelStatement;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTMacroExpansion;
|
import org.eclipse.cdt.core.dom.ast.IASTMacroExpansion;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier;
|
||||||
|
@ -73,14 +78,17 @@ import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTWhileStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignatedInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTElaboratedTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTElaboratedTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTPointer;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExplicitTemplateInstantiation;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExplicitTemplateInstantiation;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTForStatement;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTForStatement;
|
||||||
|
@ -214,7 +222,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private final TextEdit failedToFormat(AbortFormatting e) {
|
private final TextEdit failedToFormat(AbortFormatting e) {
|
||||||
if (DEBUG) {
|
|
||||||
String errorMessage= e.getMessage();
|
String errorMessage= e.getMessage();
|
||||||
if (errorMessage == null) {
|
if (errorMessage == null) {
|
||||||
if (e.nestedException != null) {
|
if (e.nestedException != null) {
|
||||||
|
@ -224,6 +231,7 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CCorePlugin.log(CCorePlugin.createStatus("Could not format: " + errorMessage, e.nestedException));
|
CCorePlugin.log(CCorePlugin.createStatus("Could not format: " + errorMessage, e.nestedException));
|
||||||
|
if (DEBUG) {
|
||||||
System.out.println("COULD NOT FORMAT: " + e.getMessage());
|
System.out.println("COULD NOT FORMAT: " + e.getMessage());
|
||||||
System.out.println(scribe.scanner); //$NON-NLS-1$
|
System.out.println(scribe.scanner); //$NON-NLS-1$
|
||||||
System.out.println(scribe);
|
System.out.println(scribe);
|
||||||
|
@ -346,8 +354,34 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTInitializer)
|
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTInitializer)
|
||||||
*/
|
*/
|
||||||
public int visit(IASTInitializer initializer) {
|
public int visit(IASTInitializer node) {
|
||||||
formatNode(initializer);
|
IASTNodeLocation[] locations= node.getNodeLocations();
|
||||||
|
if (locations.length == 0) {
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
} else if (locations[0] instanceof IASTMacroExpansion) {
|
||||||
|
formatNode(node);
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
if (node instanceof ICPPASTConstructorInitializer) {
|
||||||
|
visit((ICPPASTConstructorInitializer)node);
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peekNextToken() == Token.tASSIGN) {
|
||||||
|
scribe.printNextToken(Token.tASSIGN, scribe.printComment());
|
||||||
|
if (scribe.printComment()) {
|
||||||
|
scribe.space();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node instanceof IASTInitializerExpression) {
|
||||||
|
visit((IASTInitializerExpression)node);
|
||||||
|
} else if (node instanceof IASTInitializerList) {
|
||||||
|
visit((IASTInitializerList)node);
|
||||||
|
} else if (node instanceof ICASTDesignatedInitializer) {
|
||||||
|
formatNode(node);
|
||||||
|
} else {
|
||||||
|
formatNode(node);
|
||||||
|
}
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +403,22 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
} else if (locations[0] instanceof IASTMacroExpansion) {
|
} else if (locations[0] instanceof IASTMacroExpansion) {
|
||||||
formatNode(node);
|
formatNode(node);
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
} else
|
}
|
||||||
|
|
||||||
|
// common to all declarators
|
||||||
|
scribe.printComment();
|
||||||
|
formatPointers(node.getPointerOperators());
|
||||||
|
IASTName name= node.getName();
|
||||||
|
if (name != null) {
|
||||||
|
name.accept(this);
|
||||||
|
}
|
||||||
|
IASTDeclarator nestedDecl= node.getNestedDeclarator();
|
||||||
|
if (nestedDecl != null) {
|
||||||
|
scribe.printNextToken(Token.tLPAREN, false);
|
||||||
|
nestedDecl.accept(this);
|
||||||
|
scribe.printNextToken(Token.tRPAREN, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (node instanceof ICPPASTFunctionTryBlockDeclarator) {
|
if (node instanceof ICPPASTFunctionTryBlockDeclarator) {
|
||||||
visit((IASTStandardFunctionDeclarator)node);
|
visit((IASTStandardFunctionDeclarator)node);
|
||||||
skipNode(node);
|
skipNode(node);
|
||||||
|
@ -381,15 +430,11 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
} else if (node instanceof ICASTKnRFunctionDeclarator) {
|
} else if (node instanceof ICASTKnRFunctionDeclarator) {
|
||||||
visit((ICASTKnRFunctionDeclarator)node);
|
visit((ICASTKnRFunctionDeclarator)node);
|
||||||
} else if (node instanceof IASTFieldDeclarator) {
|
} else if (node instanceof IASTFieldDeclarator) {
|
||||||
formatNode(node);
|
visit((IASTFieldDeclarator)node);
|
||||||
return PROCESS_SKIP;
|
|
||||||
} else if (node instanceof IASTArrayDeclarator) {
|
} else if (node instanceof IASTArrayDeclarator) {
|
||||||
formatNode(node);
|
visit((IASTArrayDeclarator)node);
|
||||||
return PROCESS_SKIP;
|
|
||||||
} else {
|
|
||||||
formatNode(node);
|
|
||||||
return PROCESS_SKIP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IASTInitializer initializer= node.getInitializer();
|
IASTInitializer initializer= node.getInitializer();
|
||||||
if (initializer != null) {
|
if (initializer != null) {
|
||||||
initializer.accept(this);
|
initializer.accept(this);
|
||||||
|
@ -444,6 +489,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
visit((IASTFunctionCallExpression)node);
|
visit((IASTFunctionCallExpression)node);
|
||||||
} else if (node instanceof IASTExpressionList) {
|
} else if (node instanceof IASTExpressionList) {
|
||||||
visit((IASTExpressionList)node);
|
visit((IASTExpressionList)node);
|
||||||
|
} else if (node instanceof IASTTypeIdExpression) {
|
||||||
|
visit((IASTTypeIdExpression)node);
|
||||||
|
} else if (node instanceof IASTBinaryExpression) {
|
||||||
|
visit((IASTBinaryExpression)node);
|
||||||
|
} else if (node instanceof IASTLiteralExpression) {
|
||||||
|
visit((IASTLiteralExpression)node);
|
||||||
} else if (node instanceof IASTProblemExpression) {
|
} else if (node instanceof IASTProblemExpression) {
|
||||||
visit((IASTProblemExpression)node);
|
visit((IASTProblemExpression)node);
|
||||||
} else {
|
} else {
|
||||||
|
@ -629,6 +680,16 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int visit(ICPPASTConstructorInitializer node) {
|
||||||
|
scribe.printNextToken(Token.tLPAREN, false);
|
||||||
|
final IASTExpression value= node.getExpression();
|
||||||
|
if (value != null) {
|
||||||
|
value.accept(this);
|
||||||
|
}
|
||||||
|
scribe.printNextToken(Token.tRPAREN, false);
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
private int visit(ICPPASTConstructorChainInitializer node) {
|
private int visit(ICPPASTConstructorChainInitializer node) {
|
||||||
final IASTName member= node.getMemberInitializerId();
|
final IASTName member= node.getMemberInitializerId();
|
||||||
if (member!= null) {
|
if (member!= null) {
|
||||||
|
@ -694,21 +755,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int visit(IASTStandardFunctionDeclarator node) {
|
private int visit(IASTStandardFunctionDeclarator node) {
|
||||||
scribe.printComment();
|
|
||||||
|
|
||||||
formatPointers(node.getPointerOperators());
|
|
||||||
|
|
||||||
IASTName name= node.getName();
|
|
||||||
if (name != null) {
|
|
||||||
name.accept(this);
|
|
||||||
}
|
|
||||||
IASTDeclarator nestedDecl= node.getNestedDeclarator();
|
|
||||||
if (nestedDecl != null) {
|
|
||||||
scribe.printNextToken(Token.tLPAREN, false);
|
|
||||||
nestedDecl.accept(this);
|
|
||||||
scribe.printNextToken(Token.tRPAREN, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
final List parameters = Arrays.asList(node.getParameters());
|
final List parameters = Arrays.asList(node.getParameters());
|
||||||
final ListAlignment align= new ListAlignment(preferences.alignment_for_parameters_in_method_declaration);
|
final ListAlignment align= new ListAlignment(preferences.alignment_for_parameters_in_method_declaration);
|
||||||
align.fSpaceAfterOpeningParen= preferences.insert_space_after_opening_paren_in_method_declaration;
|
align.fSpaceAfterOpeningParen= preferences.insert_space_after_opening_paren_in_method_declaration;
|
||||||
|
@ -742,21 +788,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int visit(ICASTKnRFunctionDeclarator node) {
|
private int visit(ICASTKnRFunctionDeclarator node) {
|
||||||
scribe.printComment();
|
|
||||||
|
|
||||||
formatPointers(node.getPointerOperators());
|
|
||||||
|
|
||||||
IASTName name= node.getName();
|
|
||||||
if (name != null) {
|
|
||||||
name.accept(this);
|
|
||||||
}
|
|
||||||
IASTDeclarator nestedDecl= node.getNestedDeclarator();
|
|
||||||
if (nestedDecl != null) {
|
|
||||||
scribe.printNextToken(Token.tLPAREN, false);
|
|
||||||
nestedDecl.accept(this);
|
|
||||||
scribe.printNextToken(Token.tRPAREN, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
final List parameters= Arrays.asList(node.getParameterNames());
|
final List parameters= Arrays.asList(node.getParameterNames());
|
||||||
ListAlignment align= new ListAlignment(preferences.alignment_for_parameters_in_method_declaration);
|
ListAlignment align= new ListAlignment(preferences.alignment_for_parameters_in_method_declaration);
|
||||||
align.fSpaceAfterOpeningParen= preferences.insert_space_after_opening_paren_in_method_declaration;
|
align.fSpaceAfterOpeningParen= preferences.insert_space_after_opening_paren_in_method_declaration;
|
||||||
|
@ -779,6 +810,32 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int visit(IASTFieldDeclarator node) {
|
||||||
|
IASTExpression bitFieldSizeExpr= node.getBitFieldSize();
|
||||||
|
if (bitFieldSizeExpr != null) {
|
||||||
|
scribe.printNextToken(Token.tCOLON, true);
|
||||||
|
bitFieldSizeExpr.accept(this);
|
||||||
|
}
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int visit(IASTArrayDeclarator node) {
|
||||||
|
IASTArrayModifier[] arrayModifiers= node.getArrayModifiers();
|
||||||
|
if (arrayModifiers != null) {
|
||||||
|
for (int i = 0; i < arrayModifiers.length; i++) {
|
||||||
|
IASTArrayModifier arrayModifier = arrayModifiers[i];
|
||||||
|
scribe.printNextToken(Token.tLBRACKET, scribe.printComment());
|
||||||
|
try {
|
||||||
|
arrayModifier.accept(this);
|
||||||
|
} catch (ASTProblemException e) {
|
||||||
|
scribe.skipToToken(Token.tRBRACKET);
|
||||||
|
}
|
||||||
|
scribe.printNextToken(Token.tRBRACKET, scribe.printComment());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
private int visit(IASTSimpleDeclaration node) {
|
private int visit(IASTSimpleDeclaration node) {
|
||||||
IASTDeclSpecifier declSpec= node.getDeclSpecifier();
|
IASTDeclSpecifier declSpec= node.getDeclSpecifier();
|
||||||
declSpec.accept(this);
|
declSpec.accept(this);
|
||||||
|
@ -1014,8 +1071,13 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (token == Token.tRPAREN) {
|
} else if (token == Token.tRPAREN) {
|
||||||
|
if (encloseInParen) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!scribe.skipToToken(Token.tCOMMA)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
scribe.printNextToken(Token.tCOMMA, align.fSpaceBeforeComma);
|
scribe.printNextToken(Token.tCOMMA, align.fSpaceBeforeComma);
|
||||||
scribe.printTrailingComment();
|
scribe.printTrailingComment();
|
||||||
}
|
}
|
||||||
|
@ -1134,6 +1196,84 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int visit(IASTTypeIdExpression node) {
|
||||||
|
scribe.printNextToken(peekNextToken());
|
||||||
|
scribe.printNextToken(Token.tLPAREN);
|
||||||
|
node.getTypeId().accept(this);
|
||||||
|
scribe.printNextToken(Token.tRPAREN);
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int visit(IASTInitializerExpression node) {
|
||||||
|
node.getExpression().accept(this);
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int visit(IASTInitializerList node) {
|
||||||
|
scribe.printComment();
|
||||||
|
|
||||||
|
final List initializers = Arrays.asList(node.getInitializers());
|
||||||
|
if (initializers.isEmpty() && preferences.keep_empty_array_initializer_on_one_line) {
|
||||||
|
scribe.printNextToken(Token.tLBRACE, preferences.insert_space_before_opening_brace_in_array_initializer);
|
||||||
|
scribe.printNextToken(Token.tLBRACE, preferences.insert_space_between_empty_braces_in_array_initializer);
|
||||||
|
} else {
|
||||||
|
final int line= scribe.line;
|
||||||
|
final String brace_position= preferences.brace_position_for_array_initializer;
|
||||||
|
formatLeftCurlyBrace(line, brace_position);
|
||||||
|
formatOpeningBrace(brace_position, preferences.insert_space_before_opening_brace_in_array_initializer);
|
||||||
|
if (preferences.insert_new_line_after_opening_brace_in_array_initializer) {
|
||||||
|
scribe.printNewLine();
|
||||||
|
}
|
||||||
|
if (preferences.insert_space_after_opening_brace_in_array_initializer) {
|
||||||
|
scribe.space();
|
||||||
|
}
|
||||||
|
int indents= preferences.continuation_indentation_for_array_initializer;
|
||||||
|
while (indents-- > 0) {
|
||||||
|
scribe.indent();
|
||||||
|
}
|
||||||
|
|
||||||
|
final ListAlignment align= new ListAlignment(preferences.alignment_for_expressions_in_array_initializer);
|
||||||
|
align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_array_initializer;
|
||||||
|
align.fSpaceAfterComma= preferences.insert_space_after_comma_in_array_initializer;
|
||||||
|
formatList(initializers, align, false, false);
|
||||||
|
|
||||||
|
indents= preferences.continuation_indentation_for_array_initializer;
|
||||||
|
while (indents-- > 0) {
|
||||||
|
scribe.unIndent();
|
||||||
|
}
|
||||||
|
if (preferences.insert_new_line_before_closing_brace_in_array_initializer) {
|
||||||
|
scribe.startNewLine();
|
||||||
|
}
|
||||||
|
if (preferences.insert_space_before_closing_brace_in_array_initializer) {
|
||||||
|
scribe.space();
|
||||||
|
}
|
||||||
|
formatClosingBrace(brace_position);
|
||||||
|
}
|
||||||
|
scribe.printTrailingComment();
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int visit(IASTBinaryExpression node) {
|
||||||
|
// TODO binary expression alignment!
|
||||||
|
final IASTExpression op1= node.getOperand1();
|
||||||
|
// operand 1
|
||||||
|
op1.accept(this);
|
||||||
|
// operator
|
||||||
|
scribe.printNextToken(peekNextToken(), scribe.printComment());
|
||||||
|
if (scribe.printComment()) {
|
||||||
|
scribe.space();
|
||||||
|
}
|
||||||
|
// operand 2
|
||||||
|
final IASTExpression op2= node.getOperand2();
|
||||||
|
op2.accept(this);
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int visit(IASTLiteralExpression node) {
|
||||||
|
scribe.printNextToken(peekNextToken(), scribe.printComment());
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
|
||||||
private int visit(IASTContinueStatement node) {
|
private int visit(IASTContinueStatement node) {
|
||||||
scribe.printNextToken(Token.t_continue);
|
scribe.printNextToken(Token.t_continue);
|
||||||
scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon);
|
scribe.printNextToken(Token.tSEMI, preferences.insert_space_before_semicolon);
|
||||||
|
@ -1563,26 +1703,44 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
if (scribe.printComment()) {
|
if (scribe.printComment()) {
|
||||||
scribe.space();
|
scribe.space();
|
||||||
}
|
}
|
||||||
IASTNodeLocation location= node.getFileLocation();
|
final IASTNodeLocation[] locations= node.getNodeLocations();
|
||||||
if (location != null) {
|
final IASTNodeLocation minLocation= getMinFileLocation(locations);
|
||||||
scribe.printRaw(location.getNodeOffset(), location.getNodeLength());
|
if (minLocation != null) {
|
||||||
} else {
|
final IASTNodeLocation maxLocation= getMaxFileLocation(locations);
|
||||||
formatLocations(node.getNodeLocations());
|
if (maxLocation != null) {
|
||||||
|
final int startOffset= minLocation.getNodeOffset();
|
||||||
|
final int endOffset= maxLocation.getNodeOffset() + maxLocation.getNodeLength();
|
||||||
|
scribe.printRaw(minLocation.getNodeOffset(), endOffset - startOffset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void formatLocations(IASTNodeLocation[] locations) {
|
private static IASTFileLocation getMaxFileLocation(IASTNodeLocation[] locations) {
|
||||||
for (int i = 0; i < locations.length; i++) {
|
if (locations == null || locations.length == 0) {
|
||||||
IASTNodeLocation location = locations[i];
|
return null;
|
||||||
if (location instanceof IASTMacroExpansion) {
|
|
||||||
IASTNodeLocation[] expansionLocations= ((IASTMacroExpansion)location).getExpansionLocations();
|
|
||||||
formatLocations(expansionLocations);
|
|
||||||
} else if (location instanceof IASTFileLocation) {
|
|
||||||
if (fTranslationUnitFile.equals(((IASTFileLocation)location).getFileName())) {
|
|
||||||
scribe.printRaw(location.getNodeOffset(), location.getNodeLength());
|
|
||||||
}
|
}
|
||||||
|
final IASTNodeLocation nodeLocation= locations[locations.length-1];
|
||||||
|
if (nodeLocation instanceof IASTFileLocation) {
|
||||||
|
return (IASTFileLocation)nodeLocation;
|
||||||
|
} else if (nodeLocation instanceof IASTMacroExpansion) {
|
||||||
|
IASTNodeLocation[] macroLocations= ((IASTMacroExpansion)nodeLocation).getExpansionLocations();
|
||||||
|
return getMaxFileLocation(macroLocations);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IASTFileLocation getMinFileLocation(IASTNodeLocation[] locations) {
|
||||||
|
if (locations == null || locations.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final IASTNodeLocation nodeLocation= locations[0];
|
||||||
|
if (nodeLocation instanceof IASTFileLocation) {
|
||||||
|
return (IASTFileLocation)nodeLocation;
|
||||||
|
} else if (nodeLocation instanceof IASTMacroExpansion) {
|
||||||
|
IASTNodeLocation[] macroLocations= ((IASTMacroExpansion)nodeLocation).getExpansionLocations();
|
||||||
|
return getMinFileLocation(macroLocations);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exitAlignments() {
|
private void exitAlignments() {
|
||||||
|
@ -1590,31 +1748,32 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
scribe.exitAlignment(scribe.currentAlignment, true);
|
scribe.exitAlignment(scribe.currentAlignment, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void skipNode(IASTNode node) {
|
private void skipNode(IASTNode node) {
|
||||||
IASTNodeLocation location= node.getFileLocation();
|
final IASTNodeLocation[] locations= node.getNodeLocations();
|
||||||
if (location == null) {
|
final IASTNodeLocation maxLocation= getMaxFileLocation(locations);
|
||||||
return;
|
if (maxLocation != null) {
|
||||||
}
|
final int endOffset= maxLocation.getNodeOffset() + maxLocation.getNodeLength();
|
||||||
int endOffset= location.getNodeOffset() + location.getNodeLength();
|
final int currentOffset= scribe.scanner.getCurrentTokenEndPosition() + 1;
|
||||||
int currentOffset= scribe.scanner.getCurrentTokenEndPosition() + 1;
|
final int restLength= endOffset - currentOffset;
|
||||||
int restLength= endOffset - currentOffset;
|
|
||||||
if (restLength > 0) {
|
if (restLength > 0) {
|
||||||
scribe.printRaw(currentOffset, restLength);
|
scribe.printRaw(currentOffset, restLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void skipToNode(IASTNode node) {
|
private void skipToNode(IASTNode node) {
|
||||||
IASTNodeLocation location= node.getFileLocation();
|
final IASTNodeLocation[] locations= node.getNodeLocations();
|
||||||
if (location == null) {
|
final IASTNodeLocation minLocation= getMinFileLocation(locations);
|
||||||
return;
|
if (minLocation != null) {
|
||||||
}
|
final int startOffset= minLocation.getNodeOffset();
|
||||||
int endOffset= location.getNodeOffset();
|
final int currentOffset= scribe.scanner.getCurrentTokenEndPosition() + 1;
|
||||||
int currentOffset= scribe.scanner.getCurrentTokenEndPosition() + 1;
|
final int restLength= startOffset - currentOffset;
|
||||||
int restLength= endOffset - currentOffset;
|
|
||||||
if (restLength > 0) {
|
if (restLength > 0) {
|
||||||
scribe.printRaw(currentOffset, restLength);
|
scribe.printRaw(currentOffset, restLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void formatAction(final int line, final IASTStatement stmt, String brace_position, boolean insertLineForSingleStatement) {
|
private void formatAction(final int line, final IASTStatement stmt, String brace_position, boolean insertLineForSingleStatement) {
|
||||||
if (stmt != null) {
|
if (stmt != null) {
|
||||||
|
@ -1700,10 +1859,10 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
scribe.printTrailingComment();
|
scribe.printTrailingComment();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void formatClosingBrace(String block_brace_position) {
|
private void formatClosingBrace(String brace_position) {
|
||||||
scribe.printNextToken(Token.tRBRACE);
|
scribe.printNextToken(Token.tRBRACE);
|
||||||
scribe.printTrailingComment();
|
scribe.printTrailingComment();
|
||||||
if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(block_brace_position)) {
|
if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(brace_position)) {
|
||||||
scribe.unIndent();
|
scribe.unIndent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ public class DefaultCodeFormatterOptions {
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public int alignment_for_arguments_in_allocation_expression;
|
// public int alignment_for_arguments_in_allocation_expression;
|
||||||
// public int alignment_for_arguments_in_enum_constant;
|
// public int alignment_for_arguments_in_enum_constant;
|
||||||
// public int alignment_for_arguments_in_explicit_constructor_call;
|
// public int alignment_for_arguments_in_explicit_constructor_call;
|
||||||
|
@ -89,7 +88,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
public String brace_position_for_switch;
|
public String brace_position_for_switch;
|
||||||
|
|
||||||
public int continuation_indentation;
|
public int continuation_indentation;
|
||||||
// public int continuation_indentation_for_array_initializer;
|
public int continuation_indentation_for_array_initializer;
|
||||||
|
|
||||||
// public int blank_lines_after_includes;
|
// public int blank_lines_after_includes;
|
||||||
// public int blank_lines_before_field;
|
// public int blank_lines_before_field;
|
||||||
|
@ -121,10 +120,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
public boolean indent_switchstatements_compare_to_switch;
|
public boolean indent_switchstatements_compare_to_switch;
|
||||||
public int indentation_size;
|
public int indentation_size;
|
||||||
|
|
||||||
// public boolean insert_new_line_after_opening_brace_in_array_initializer;
|
public boolean insert_new_line_after_opening_brace_in_array_initializer;
|
||||||
public boolean insert_new_line_at_end_of_file_if_missing;
|
public boolean insert_new_line_at_end_of_file_if_missing;
|
||||||
// public boolean insert_new_line_before_catch_in_try_statement;
|
// public boolean insert_new_line_before_catch_in_try_statement;
|
||||||
// public boolean insert_new_line_before_closing_brace_in_array_initializer;
|
public boolean insert_new_line_before_closing_brace_in_array_initializer;
|
||||||
public boolean insert_new_line_before_else_in_if_statement;
|
public boolean insert_new_line_before_else_in_if_statement;
|
||||||
// public boolean insert_new_line_before_finally_in_try_statement;
|
// public boolean insert_new_line_before_finally_in_try_statement;
|
||||||
public boolean insert_new_line_before_while_in_do_statement;
|
public boolean insert_new_line_before_while_in_do_statement;
|
||||||
|
@ -145,7 +144,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// public boolean insert_space_after_colon_in_for;
|
// public boolean insert_space_after_colon_in_for;
|
||||||
// public boolean insert_space_after_colon_in_labeled_statement;
|
// public boolean insert_space_after_colon_in_labeled_statement;
|
||||||
// public boolean insert_space_after_comma_in_allocation_expression;
|
// public boolean insert_space_after_comma_in_allocation_expression;
|
||||||
// public boolean insert_space_after_comma_in_array_initializer;
|
public boolean insert_space_after_comma_in_array_initializer;
|
||||||
// public boolean insert_space_after_comma_in_constructor_declaration_parameters;
|
// public boolean insert_space_after_comma_in_constructor_declaration_parameters;
|
||||||
// public boolean insert_space_after_comma_in_constructor_declaration_throws;
|
// public boolean insert_space_after_comma_in_constructor_declaration_throws;
|
||||||
// public boolean insert_space_after_comma_in_enum_constant_arguments;
|
// public boolean insert_space_after_comma_in_enum_constant_arguments;
|
||||||
|
@ -168,7 +167,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// public boolean insert_space_after_opening_angle_bracket_in_type_parameters;
|
// public boolean insert_space_after_opening_angle_bracket_in_type_parameters;
|
||||||
// public boolean insert_space_after_opening_bracket_in_array_allocation_expression;
|
// public boolean insert_space_after_opening_bracket_in_array_allocation_expression;
|
||||||
// public boolean insert_space_after_opening_bracket_in_array_reference;
|
// public boolean insert_space_after_opening_bracket_in_array_reference;
|
||||||
// public boolean insert_space_after_opening_brace_in_array_initializer;
|
public boolean insert_space_after_opening_brace_in_array_initializer;
|
||||||
// public boolean insert_space_after_opening_paren_in_cast;
|
// public boolean insert_space_after_opening_paren_in_cast;
|
||||||
// public boolean insert_space_after_opening_paren_in_catch;
|
// public boolean insert_space_after_opening_paren_in_catch;
|
||||||
// public boolean insert_space_after_opening_paren_in_constructor_declaration;
|
// public boolean insert_space_after_opening_paren_in_constructor_declaration;
|
||||||
|
@ -191,7 +190,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// public boolean insert_space_before_closing_angle_bracket_in_parameterized_type_reference;
|
// public boolean insert_space_before_closing_angle_bracket_in_parameterized_type_reference;
|
||||||
// public boolean insert_space_before_closing_angle_bracket_in_type_arguments;
|
// public boolean insert_space_before_closing_angle_bracket_in_type_arguments;
|
||||||
// public boolean insert_space_before_closing_angle_bracket_in_type_parameters;
|
// public boolean insert_space_before_closing_angle_bracket_in_type_parameters;
|
||||||
// public boolean insert_space_before_closing_brace_in_array_initializer;
|
public boolean insert_space_before_closing_brace_in_array_initializer;
|
||||||
// public boolean insert_space_before_closing_bracket_in_array_allocation_expression;
|
// public boolean insert_space_before_closing_bracket_in_array_allocation_expression;
|
||||||
// public boolean insert_space_before_closing_bracket_in_array_reference;
|
// public boolean insert_space_before_closing_bracket_in_array_reference;
|
||||||
// public boolean insert_space_before_closing_paren_in_cast;
|
// public boolean insert_space_before_closing_paren_in_cast;
|
||||||
|
@ -211,7 +210,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// public boolean insert_space_before_colon_in_for;
|
// public boolean insert_space_before_colon_in_for;
|
||||||
// public boolean insert_space_before_colon_in_labeled_statement;
|
// public boolean insert_space_before_colon_in_labeled_statement;
|
||||||
// public boolean insert_space_before_comma_in_allocation_expression;
|
// public boolean insert_space_before_comma_in_allocation_expression;
|
||||||
// public boolean insert_space_before_comma_in_array_initializer;
|
public boolean insert_space_before_comma_in_array_initializer;
|
||||||
// public boolean insert_space_before_comma_in_constructor_declaration_parameters;
|
// public boolean insert_space_before_comma_in_constructor_declaration_parameters;
|
||||||
// public boolean insert_space_before_comma_in_constructor_declaration_throws;
|
// public boolean insert_space_before_comma_in_constructor_declaration_throws;
|
||||||
// public boolean insert_space_before_comma_in_enum_constant_arguments;
|
// public boolean insert_space_before_comma_in_enum_constant_arguments;
|
||||||
|
@ -233,7 +232,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// public boolean insert_space_before_opening_angle_bracket_in_parameterized_type_reference;
|
// public boolean insert_space_before_opening_angle_bracket_in_parameterized_type_reference;
|
||||||
// public boolean insert_space_before_opening_angle_bracket_in_type_arguments;
|
// public boolean insert_space_before_opening_angle_bracket_in_type_arguments;
|
||||||
// public boolean insert_space_before_opening_angle_bracket_in_type_parameters;
|
// public boolean insert_space_before_opening_angle_bracket_in_type_parameters;
|
||||||
// public boolean insert_space_before_opening_brace_in_array_initializer;
|
public boolean insert_space_before_opening_brace_in_array_initializer;
|
||||||
public boolean insert_space_before_opening_brace_in_block;
|
public boolean insert_space_before_opening_brace_in_block;
|
||||||
// public boolean insert_space_before_opening_brace_in_constructor_declaration;
|
// public boolean insert_space_before_opening_brace_in_constructor_declaration;
|
||||||
// public boolean insert_space_before_opening_brace_in_enum_constant;
|
// public boolean insert_space_before_opening_brace_in_enum_constant;
|
||||||
|
@ -262,7 +261,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
public boolean insert_space_before_semicolon_in_for;
|
public boolean insert_space_before_semicolon_in_for;
|
||||||
// public boolean insert_space_before_unary_operator;
|
// public boolean insert_space_before_unary_operator;
|
||||||
// public boolean insert_space_between_brackets_in_array_type_reference;
|
// public boolean insert_space_between_brackets_in_array_type_reference;
|
||||||
// public boolean insert_space_between_empty_braces_in_array_initializer;
|
public boolean insert_space_between_empty_braces_in_array_initializer;
|
||||||
// public boolean insert_space_between_empty_brackets_in_array_allocation_expression;
|
// public boolean insert_space_between_empty_brackets_in_array_allocation_expression;
|
||||||
// public boolean insert_space_between_empty_parens_in_constructor_declaration;
|
// public boolean insert_space_between_empty_parens_in_constructor_declaration;
|
||||||
// public boolean insert_space_between_empty_parens_in_enum_constant;
|
// public boolean insert_space_between_empty_parens_in_enum_constant;
|
||||||
|
@ -271,7 +270,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
public boolean compact_else_if;
|
public boolean compact_else_if;
|
||||||
public boolean keep_guardian_clause_on_one_line;
|
public boolean keep_guardian_clause_on_one_line;
|
||||||
public boolean keep_else_statement_on_same_line;
|
public boolean keep_else_statement_on_same_line;
|
||||||
// public boolean keep_empty_array_initializer_on_one_line;
|
public boolean keep_empty_array_initializer_on_one_line;
|
||||||
public boolean keep_simple_if_on_one_line;
|
public boolean keep_simple_if_on_one_line;
|
||||||
public boolean keep_then_statement_on_same_line;
|
public boolean keep_then_statement_on_same_line;
|
||||||
public int number_of_empty_lines_to_preserve;
|
public int number_of_empty_lines_to_preserve;
|
||||||
|
@ -335,7 +334,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, this.comment_format_source ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, this.comment_format_source ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length));
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length));
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, Integer.toString(this.continuation_indentation));
|
options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, Integer.toString(this.continuation_indentation));
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, Integer.toString(this.continuation_indentation_for_array_initializer));
|
options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, Integer.toString(this.continuation_indentation_for_array_initializer));
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, Integer.toString(this.blank_lines_after_includes));
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, Integer.toString(this.blank_lines_after_includes));
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD, Integer.toString(this.blank_lines_before_field));
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD, Integer.toString(this.blank_lines_before_field));
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, Integer.toString(this.blank_lines_before_first_class_body_declaration));
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, Integer.toString(this.blank_lines_before_first_class_body_declaration));
|
||||||
|
@ -357,10 +356,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, this.insert_new_line_at_end_of_file_if_missing ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, this.insert_new_line_at_end_of_file_if_missing ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, this.insert_new_line_before_catch_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, this.insert_new_line_before_catch_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, this.insert_new_line_before_else_in_if_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, this.insert_new_line_before_else_in_if_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, this.insert_new_line_before_finally_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, this.insert_new_line_before_finally_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -381,7 +380,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR, this.insert_space_after_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR, this.insert_space_after_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_after_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_after_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_after_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_after_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_after_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_after_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_after_comma_in_enum_constant_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_after_comma_in_enum_constant_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -404,7 +403,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_after_opening_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_after_opening_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, this.insert_space_after_opening_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, this.insert_space_after_opening_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, this.insert_space_after_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, this.insert_space_after_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_after_opening_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_after_opening_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -427,7 +426,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_closing_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_closing_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_closing_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_closing_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_before_closing_bracket_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_before_closing_bracket_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_before_closing_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_before_closing_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, this.insert_space_before_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, this.insert_space_before_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -447,7 +446,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR, this.insert_space_before_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR, this.insert_space_before_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_before_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_before_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_before_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_before_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_before_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_before_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_before_comma_in_enum_constant_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_before_comma_in_enum_constant_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -468,7 +467,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, this.insert_space_before_opening_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, this.insert_space_before_opening_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_opening_brace_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_opening_brace_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT, this.insert_space_before_opening_brace_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT, this.insert_space_before_opening_brace_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -498,7 +497,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, this.insert_space_before_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, this.insert_space_before_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, this.insert_space_before_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, this.insert_space_before_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE, this.insert_space_between_brackets_in_array_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE, this.insert_space_between_brackets_in_array_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, this.insert_space_between_empty_braces_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, this.insert_space_between_empty_braces_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_between_empty_brackets_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_between_empty_brackets_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION, this.insert_space_between_empty_parens_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION, this.insert_space_between_empty_parens_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT, this.insert_space_between_empty_parens_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
// options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT, this.insert_space_between_empty_parens_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
|
||||||
|
@ -507,7 +506,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, this.compact_else_if ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, this.compact_else_if ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE, this.keep_guardian_clause_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE, this.keep_guardian_clause_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE, this.keep_else_statement_on_same_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE, this.keep_else_statement_on_same_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
// options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, this.keep_empty_array_initializer_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, this.keep_empty_array_initializer_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE, this.keep_simple_if_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE, this.keep_simple_if_on_one_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE, this.keep_then_statement_on_same_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE, this.keep_then_statement_on_same_line ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
|
||||||
options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, Integer.toString(this.number_of_empty_lines_to_preserve));
|
options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, Integer.toString(this.number_of_empty_lines_to_preserve));
|
||||||
|
@ -804,16 +803,16 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.continuation_indentation = 2;
|
this.continuation_indentation = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// final Object continuationIndentationForArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER);
|
final Object continuationIndentationForArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER);
|
||||||
// if (continuationIndentationForArrayInitializerOption != null) {
|
if (continuationIndentationForArrayInitializerOption != null) {
|
||||||
// try {
|
try {
|
||||||
// this.continuation_indentation_for_array_initializer = Integer.parseInt((String) continuationIndentationForArrayInitializerOption);
|
this.continuation_indentation_for_array_initializer = Integer.parseInt((String) continuationIndentationForArrayInitializerOption);
|
||||||
// } catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
// this.continuation_indentation_for_array_initializer = 2;
|
this.continuation_indentation_for_array_initializer = 2;
|
||||||
// } catch(ClassCastException e) {
|
} catch(ClassCastException e) {
|
||||||
// this.continuation_indentation_for_array_initializer = 2;
|
this.continuation_indentation_for_array_initializer = 2;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// final Object blankLinesAfterIncludesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS);
|
// final Object blankLinesAfterIncludesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS);
|
||||||
// if (blankLinesAfterIncludesOption != null) {
|
// if (blankLinesAfterIncludesOption != null) {
|
||||||
// try {
|
// try {
|
||||||
|
@ -988,10 +987,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.indentation_size = 4;
|
this.indentation_size = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
|
final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
|
||||||
// if (insertNewLineAfterOpeningBraceInArrayInitializerOption != null) {
|
if (insertNewLineAfterOpeningBraceInArrayInitializerOption != null) {
|
||||||
// this.insert_new_line_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineAfterOpeningBraceInArrayInitializerOption);
|
this.insert_new_line_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineAfterOpeningBraceInArrayInitializerOption);
|
||||||
// }
|
}
|
||||||
final Object insertNewLineAtEndOfFileIfMissingOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING);
|
final Object insertNewLineAtEndOfFileIfMissingOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING);
|
||||||
if (insertNewLineAtEndOfFileIfMissingOption != null) {
|
if (insertNewLineAtEndOfFileIfMissingOption != null) {
|
||||||
this.insert_new_line_at_end_of_file_if_missing = CCorePlugin.INSERT.equals(insertNewLineAtEndOfFileIfMissingOption);
|
this.insert_new_line_at_end_of_file_if_missing = CCorePlugin.INSERT.equals(insertNewLineAtEndOfFileIfMissingOption);
|
||||||
|
@ -1000,10 +999,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
// if (insertNewLineBeforeCatchInTryStatementOption != null) {
|
// if (insertNewLineBeforeCatchInTryStatementOption != null) {
|
||||||
// this.insert_new_line_before_catch_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeCatchInTryStatementOption);
|
// this.insert_new_line_before_catch_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeCatchInTryStatementOption);
|
||||||
// }
|
// }
|
||||||
// final Object insertNewLineBeforeClosingBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER);
|
final Object insertNewLineBeforeClosingBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER);
|
||||||
// if (insertNewLineBeforeClosingBraceInArrayInitializerOption != null) {
|
if (insertNewLineBeforeClosingBraceInArrayInitializerOption != null) {
|
||||||
// this.insert_new_line_before_closing_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineBeforeClosingBraceInArrayInitializerOption);
|
this.insert_new_line_before_closing_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineBeforeClosingBraceInArrayInitializerOption);
|
||||||
// }
|
}
|
||||||
final Object insertNewLineBeforeElseInIfStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT);
|
final Object insertNewLineBeforeElseInIfStatementOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT);
|
||||||
if (insertNewLineBeforeElseInIfStatementOption != null) {
|
if (insertNewLineBeforeElseInIfStatementOption != null) {
|
||||||
this.insert_new_line_before_else_in_if_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeElseInIfStatementOption);
|
this.insert_new_line_before_else_in_if_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeElseInIfStatementOption);
|
||||||
|
@ -1084,10 +1083,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
// if (insertSpaceAfterCommaInAllocationExpressionOption != null) {
|
// if (insertSpaceAfterCommaInAllocationExpressionOption != null) {
|
||||||
// this.insert_space_after_comma_in_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInAllocationExpressionOption);
|
// this.insert_space_after_comma_in_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInAllocationExpressionOption);
|
||||||
// }
|
// }
|
||||||
// final Object insertSpaceAfterCommaInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER);
|
final Object insertSpaceAfterCommaInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER);
|
||||||
// if (insertSpaceAfterCommaInArrayInitializerOption != null) {
|
if (insertSpaceAfterCommaInArrayInitializerOption != null) {
|
||||||
// this.insert_space_after_comma_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInArrayInitializerOption);
|
this.insert_space_after_comma_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInArrayInitializerOption);
|
||||||
// }
|
}
|
||||||
// final Object insertSpaceAfterCommaInConstructorDeclarationParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS);
|
// final Object insertSpaceAfterCommaInConstructorDeclarationParametersOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS);
|
||||||
// if (insertSpaceAfterCommaInConstructorDeclarationParametersOption != null) {
|
// if (insertSpaceAfterCommaInConstructorDeclarationParametersOption != null) {
|
||||||
// this.insert_space_after_comma_in_constructor_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInConstructorDeclarationParametersOption);
|
// this.insert_space_after_comma_in_constructor_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInConstructorDeclarationParametersOption);
|
||||||
|
@ -1176,10 +1175,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
// if (insertSpaceAfterOpeningBracketInArrayReferenceOption != null) {
|
// if (insertSpaceAfterOpeningBracketInArrayReferenceOption != null) {
|
||||||
// this.insert_space_after_opening_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayReferenceOption);
|
// this.insert_space_after_opening_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayReferenceOption);
|
||||||
// }
|
// }
|
||||||
// final Object insertSpaceAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
|
final Object insertSpaceAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
|
||||||
// if (insertSpaceAfterOpeningBraceInArrayInitializerOption != null) {
|
if (insertSpaceAfterOpeningBraceInArrayInitializerOption != null) {
|
||||||
// this.insert_space_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBraceInArrayInitializerOption);
|
this.insert_space_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBraceInArrayInitializerOption);
|
||||||
// }
|
}
|
||||||
// final Object insertSpaceAfterOpeningParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST);
|
// final Object insertSpaceAfterOpeningParenInCastOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST);
|
||||||
// if (insertSpaceAfterOpeningParenInCastOption != null) {
|
// if (insertSpaceAfterOpeningParenInCastOption != null) {
|
||||||
// this.insert_space_after_opening_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCastOption);
|
// this.insert_space_after_opening_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCastOption);
|
||||||
|
@ -1691,7 +1690,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// this.comment_insert_new_line_for_parameter = true;
|
// this.comment_insert_new_line_for_parameter = true;
|
||||||
// this.comment_line_length = 80;
|
// this.comment_line_length = 80;
|
||||||
this.continuation_indentation = 2;
|
this.continuation_indentation = 2;
|
||||||
// this.continuation_indentation_for_array_initializer = 2;
|
this.continuation_indentation_for_array_initializer = 2;
|
||||||
// this.blank_lines_after_includes = 1;
|
// this.blank_lines_after_includes = 1;
|
||||||
// this.blank_lines_before_field = 1;
|
// this.blank_lines_before_field = 1;
|
||||||
// this.blank_lines_before_first_class_body_declaration = 0;
|
// this.blank_lines_before_first_class_body_declaration = 0;
|
||||||
|
@ -1712,10 +1711,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.indent_switchstatements_compare_to_cases = true;
|
this.indent_switchstatements_compare_to_cases = true;
|
||||||
this.indent_switchstatements_compare_to_switch = false;
|
this.indent_switchstatements_compare_to_switch = false;
|
||||||
this.indentation_size = 4;
|
this.indentation_size = 4;
|
||||||
// this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
||||||
this.insert_new_line_at_end_of_file_if_missing = false;
|
this.insert_new_line_at_end_of_file_if_missing = false;
|
||||||
// this.insert_new_line_before_catch_in_try_statement = false;
|
// this.insert_new_line_before_catch_in_try_statement = false;
|
||||||
// this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
||||||
this.insert_new_line_before_else_in_if_statement = false;
|
this.insert_new_line_before_else_in_if_statement = false;
|
||||||
// this.insert_new_line_before_finally_in_try_statement = false;
|
// this.insert_new_line_before_finally_in_try_statement = false;
|
||||||
this.insert_new_line_before_while_in_do_statement = false;
|
this.insert_new_line_before_while_in_do_statement = false;
|
||||||
|
@ -1736,7 +1735,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// this.insert_space_after_colon_in_for = true;
|
// this.insert_space_after_colon_in_for = true;
|
||||||
// this.insert_space_after_colon_in_labeled_statement = true;
|
// this.insert_space_after_colon_in_labeled_statement = true;
|
||||||
// this.insert_space_after_comma_in_allocation_expression = true;
|
// this.insert_space_after_comma_in_allocation_expression = true;
|
||||||
// this.insert_space_after_comma_in_array_initializer = true;
|
this.insert_space_after_comma_in_array_initializer = true;
|
||||||
// this.insert_space_after_comma_in_constructor_declaration_parameters = true;
|
// this.insert_space_after_comma_in_constructor_declaration_parameters = true;
|
||||||
// this.insert_space_after_comma_in_constructor_declaration_throws = true;
|
// this.insert_space_after_comma_in_constructor_declaration_throws = true;
|
||||||
// this.insert_space_after_comma_in_enum_constant_arguments = true;
|
// this.insert_space_after_comma_in_enum_constant_arguments = true;
|
||||||
|
@ -1759,7 +1758,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// this.insert_space_after_opening_angle_bracket_in_type_parameters = false;
|
// this.insert_space_after_opening_angle_bracket_in_type_parameters = false;
|
||||||
// this.insert_space_after_opening_bracket_in_array_allocation_expression = false;
|
// this.insert_space_after_opening_bracket_in_array_allocation_expression = false;
|
||||||
// this.insert_space_after_opening_bracket_in_array_reference = false;
|
// this.insert_space_after_opening_bracket_in_array_reference = false;
|
||||||
// this.insert_space_after_opening_brace_in_array_initializer = true;
|
this.insert_space_after_opening_brace_in_array_initializer = true;
|
||||||
// this.insert_space_after_opening_paren_in_cast = false;
|
// this.insert_space_after_opening_paren_in_cast = false;
|
||||||
// this.insert_space_after_opening_paren_in_catch = false;
|
// this.insert_space_after_opening_paren_in_catch = false;
|
||||||
// this.insert_space_after_opening_paren_in_constructor_declaration = false;
|
// this.insert_space_after_opening_paren_in_constructor_declaration = false;
|
||||||
|
@ -1782,7 +1781,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false;
|
// this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false;
|
||||||
// this.insert_space_before_closing_angle_bracket_in_type_arguments = false;
|
// this.insert_space_before_closing_angle_bracket_in_type_arguments = false;
|
||||||
// this.insert_space_before_closing_angle_bracket_in_type_parameters = false;
|
// this.insert_space_before_closing_angle_bracket_in_type_parameters = false;
|
||||||
// this.insert_space_before_closing_brace_in_array_initializer = true;
|
this.insert_space_before_closing_brace_in_array_initializer = true;
|
||||||
// this.insert_space_before_closing_bracket_in_array_allocation_expression = false;
|
// this.insert_space_before_closing_bracket_in_array_allocation_expression = false;
|
||||||
// this.insert_space_before_closing_bracket_in_array_reference = false;
|
// this.insert_space_before_closing_bracket_in_array_reference = false;
|
||||||
// this.insert_space_before_closing_paren_in_cast = false;
|
// this.insert_space_before_closing_paren_in_cast = false;
|
||||||
|
@ -1802,7 +1801,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// this.insert_space_before_colon_in_for = true;
|
// this.insert_space_before_colon_in_for = true;
|
||||||
// this.insert_space_before_colon_in_labeled_statement = false;
|
// this.insert_space_before_colon_in_labeled_statement = false;
|
||||||
// this.insert_space_before_comma_in_allocation_expression = false;
|
// this.insert_space_before_comma_in_allocation_expression = false;
|
||||||
// this.insert_space_before_comma_in_array_initializer = false;
|
this.insert_space_before_comma_in_array_initializer = false;
|
||||||
// this.insert_space_before_comma_in_constructor_declaration_parameters = false;
|
// this.insert_space_before_comma_in_constructor_declaration_parameters = false;
|
||||||
// this.insert_space_before_comma_in_constructor_declaration_throws = false;
|
// this.insert_space_before_comma_in_constructor_declaration_throws = false;
|
||||||
// this.insert_space_before_comma_in_enum_constant_arguments = false;
|
// this.insert_space_before_comma_in_enum_constant_arguments = false;
|
||||||
|
@ -1824,7 +1823,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
// this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false;
|
// this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false;
|
||||||
// this.insert_space_before_opening_angle_bracket_in_type_arguments = false;
|
// this.insert_space_before_opening_angle_bracket_in_type_arguments = false;
|
||||||
// this.insert_space_before_opening_angle_bracket_in_type_parameters = false;
|
// this.insert_space_before_opening_angle_bracket_in_type_parameters = false;
|
||||||
// this.insert_space_before_opening_brace_in_array_initializer = true;
|
this.insert_space_before_opening_brace_in_array_initializer = true;
|
||||||
this.insert_space_before_opening_brace_in_block = true;
|
this.insert_space_before_opening_brace_in_block = true;
|
||||||
// this.insert_space_before_opening_brace_in_constructor_declaration = true;
|
// this.insert_space_before_opening_brace_in_constructor_declaration = true;
|
||||||
// this.insert_space_before_opening_brace_in_enum_constant = true;
|
// this.insert_space_before_opening_brace_in_enum_constant = true;
|
||||||
|
@ -1853,7 +1852,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.insert_space_before_semicolon_in_for = false;
|
this.insert_space_before_semicolon_in_for = false;
|
||||||
// this.insert_space_before_unary_operator = false;
|
// this.insert_space_before_unary_operator = false;
|
||||||
// this.insert_space_between_brackets_in_array_type_reference = false;
|
// this.insert_space_between_brackets_in_array_type_reference = false;
|
||||||
// this.insert_space_between_empty_braces_in_array_initializer = false;
|
this.insert_space_between_empty_braces_in_array_initializer = false;
|
||||||
// this.insert_space_between_empty_brackets_in_array_allocation_expression = false;
|
// this.insert_space_between_empty_brackets_in_array_allocation_expression = false;
|
||||||
// this.insert_space_between_empty_parens_in_constructor_declaration = false;
|
// this.insert_space_between_empty_parens_in_constructor_declaration = false;
|
||||||
// this.insert_space_between_empty_parens_in_enum_constant = false;
|
// this.insert_space_between_empty_parens_in_enum_constant = false;
|
||||||
|
@ -1862,7 +1861,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.compact_else_if = true;
|
this.compact_else_if = true;
|
||||||
this.keep_guardian_clause_on_one_line = false;
|
this.keep_guardian_clause_on_one_line = false;
|
||||||
this.keep_else_statement_on_same_line = false;
|
this.keep_else_statement_on_same_line = false;
|
||||||
// this.keep_empty_array_initializer_on_one_line = false;
|
this.keep_empty_array_initializer_on_one_line = false;
|
||||||
this.keep_simple_if_on_one_line = false;
|
this.keep_simple_if_on_one_line = false;
|
||||||
this.keep_then_statement_on_same_line = false;
|
this.keep_then_statement_on_same_line = false;
|
||||||
this.number_of_empty_lines_to_preserve = 1;
|
this.number_of_empty_lines_to_preserve = 1;
|
||||||
|
@ -1938,10 +1937,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.indent_switchstatements_compare_to_switch = false;
|
this.indent_switchstatements_compare_to_switch = false;
|
||||||
this.indentation_size = 4;
|
this.indentation_size = 4;
|
||||||
|
|
||||||
// this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
||||||
this.insert_new_line_at_end_of_file_if_missing = false;
|
this.insert_new_line_at_end_of_file_if_missing = false;
|
||||||
// this.insert_new_line_before_catch_in_try_statement = false;
|
// this.insert_new_line_before_catch_in_try_statement = false;
|
||||||
// this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
||||||
this.insert_new_line_before_else_in_if_statement = true;
|
this.insert_new_line_before_else_in_if_statement = true;
|
||||||
// this.insert_new_line_before_finally_in_try_statement = false;
|
// this.insert_new_line_before_finally_in_try_statement = false;
|
||||||
this.insert_new_line_before_while_in_do_statement = false;
|
this.insert_new_line_before_while_in_do_statement = false;
|
||||||
|
@ -1954,7 +1953,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.compact_else_if = true;
|
this.compact_else_if = true;
|
||||||
this.keep_guardian_clause_on_one_line = false;
|
this.keep_guardian_clause_on_one_line = false;
|
||||||
this.keep_else_statement_on_same_line = false;
|
this.keep_else_statement_on_same_line = false;
|
||||||
// this.keep_empty_array_initializer_on_one_line = false;
|
this.keep_empty_array_initializer_on_one_line = false;
|
||||||
this.keep_simple_if_on_one_line = false;
|
this.keep_simple_if_on_one_line = false;
|
||||||
this.keep_then_statement_on_same_line = false;
|
this.keep_then_statement_on_same_line = false;
|
||||||
this.number_of_empty_lines_to_preserve = 1;
|
this.number_of_empty_lines_to_preserve = 1;
|
||||||
|
@ -2012,10 +2011,10 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.indent_switchstatements_compare_to_switch = false;
|
this.indent_switchstatements_compare_to_switch = false;
|
||||||
this.indentation_size = 8;
|
this.indentation_size = 8;
|
||||||
|
|
||||||
// this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
||||||
this.insert_new_line_at_end_of_file_if_missing = false;
|
this.insert_new_line_at_end_of_file_if_missing = false;
|
||||||
// this.insert_new_line_before_catch_in_try_statement = false;
|
// this.insert_new_line_before_catch_in_try_statement = false;
|
||||||
// this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
||||||
this.insert_new_line_before_else_in_if_statement = true;
|
this.insert_new_line_before_else_in_if_statement = true;
|
||||||
// this.insert_new_line_before_finally_in_try_statement = false;
|
// this.insert_new_line_before_finally_in_try_statement = false;
|
||||||
this.insert_new_line_before_while_in_do_statement = false;
|
this.insert_new_line_before_while_in_do_statement = false;
|
||||||
|
@ -2028,7 +2027,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.compact_else_if = true;
|
this.compact_else_if = true;
|
||||||
this.keep_guardian_clause_on_one_line = false;
|
this.keep_guardian_clause_on_one_line = false;
|
||||||
this.keep_else_statement_on_same_line = false;
|
this.keep_else_statement_on_same_line = false;
|
||||||
// this.keep_empty_array_initializer_on_one_line = false;
|
this.keep_empty_array_initializer_on_one_line = false;
|
||||||
this.keep_simple_if_on_one_line = false;
|
this.keep_simple_if_on_one_line = false;
|
||||||
this.keep_then_statement_on_same_line = false;
|
this.keep_then_statement_on_same_line = false;
|
||||||
this.number_of_empty_lines_to_preserve = 1;
|
this.number_of_empty_lines_to_preserve = 1;
|
||||||
|
@ -2061,6 +2060,8 @@ public class DefaultCodeFormatterOptions {
|
||||||
*/
|
*/
|
||||||
public void setWhitesmitsSettings() {
|
public void setWhitesmitsSettings() {
|
||||||
setDefaultSettings();
|
setDefaultSettings();
|
||||||
|
this.alignment_for_expressions_in_array_initializer = Alignment.M_ONE_PER_LINE_SPLIT;
|
||||||
|
|
||||||
this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
|
this.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
|
||||||
this.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
|
this.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
|
||||||
this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
|
this.brace_position_for_block_in_case = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
|
||||||
|
@ -2084,12 +2085,12 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.indent_switchstatements_compare_to_switch = false;
|
this.indent_switchstatements_compare_to_switch = false;
|
||||||
this.indentation_size = 4;
|
this.indentation_size = 4;
|
||||||
|
|
||||||
// this.insert_new_line_after_opening_brace_in_array_initializer = false;
|
this.insert_new_line_after_opening_brace_in_array_initializer = true;
|
||||||
this.insert_new_line_at_end_of_file_if_missing = false;
|
this.insert_new_line_at_end_of_file_if_missing = false;
|
||||||
// this.insert_new_line_before_catch_in_try_statement = false;
|
// this.insert_new_line_before_catch_in_try_statement = true;
|
||||||
// this.insert_new_line_before_closing_brace_in_array_initializer = false;
|
this.insert_new_line_before_closing_brace_in_array_initializer = true;
|
||||||
this.insert_new_line_before_else_in_if_statement = true;
|
this.insert_new_line_before_else_in_if_statement = true;
|
||||||
// this.insert_new_line_before_finally_in_try_statement = false;
|
// this.insert_new_line_before_finally_in_try_statement = true;
|
||||||
this.insert_new_line_before_while_in_do_statement = true;
|
this.insert_new_line_before_while_in_do_statement = true;
|
||||||
this.insert_new_line_in_empty_block = true;
|
this.insert_new_line_in_empty_block = true;
|
||||||
// this.insert_new_line_in_empty_enum_constant = true;
|
// this.insert_new_line_in_empty_enum_constant = true;
|
||||||
|
@ -2100,7 +2101,7 @@ public class DefaultCodeFormatterOptions {
|
||||||
this.compact_else_if = false;
|
this.compact_else_if = false;
|
||||||
this.keep_guardian_clause_on_one_line = false;
|
this.keep_guardian_clause_on_one_line = false;
|
||||||
this.keep_else_statement_on_same_line = false;
|
this.keep_else_statement_on_same_line = false;
|
||||||
// this.keep_empty_array_initializer_on_one_line = false;
|
this.keep_empty_array_initializer_on_one_line = false;
|
||||||
this.keep_simple_if_on_one_line = false;
|
this.keep_simple_if_on_one_line = false;
|
||||||
this.keep_then_statement_on_same_line = false;
|
this.keep_then_statement_on_same_line = false;
|
||||||
this.number_of_empty_lines_to_preserve = 1;
|
this.number_of_empty_lines_to_preserve = 1;
|
||||||
|
|
|
@ -643,7 +643,7 @@ public class Scribe {
|
||||||
switch (currentToken.type) {
|
switch (currentToken.type) {
|
||||||
case Token.tLBRACE:
|
case Token.tLBRACE:
|
||||||
scanner.resetTo(scanner.getCurrentTokenStartPosition(), scannerEndPosition-1);
|
scanner.resetTo(scanner.getCurrentTokenStartPosition(), scannerEndPosition-1);
|
||||||
formatOpeningBrace(formatter.preferences.brace_position_for_block, hasWhitespace);
|
formatOpeningBrace(formatter.preferences.brace_position_for_block, formatter.preferences.insert_space_before_opening_brace_in_block);
|
||||||
if (formatter.preferences.indent_statements_compare_to_block) {
|
if (formatter.preferences.indent_statements_compare_to_block) {
|
||||||
indent();
|
indent();
|
||||||
}
|
}
|
||||||
|
@ -1543,13 +1543,17 @@ public class Scribe {
|
||||||
while ((currentToken= scanner.nextToken()) != null) {
|
while ((currentToken= scanner.nextToken()) != null) {
|
||||||
switch (currentToken.type) {
|
switch (currentToken.type) {
|
||||||
case Token.tLBRACE:
|
case Token.tLBRACE:
|
||||||
|
if (expectedTokenType != Token.tLBRACE) {
|
||||||
++braceLevel;
|
++braceLevel;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Token.tRBRACE:
|
case Token.tRBRACE:
|
||||||
--braceLevel;
|
--braceLevel;
|
||||||
break;
|
break;
|
||||||
case Token.tLPAREN:
|
case Token.tLPAREN:
|
||||||
|
if (expectedTokenType != Token.tLPAREN) {
|
||||||
++parenLevel;
|
++parenLevel;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Token.tRPAREN:
|
case Token.tRPAREN:
|
||||||
--parenLevel;
|
--parenLevel;
|
||||||
|
|
|
@ -3,3 +3,5 @@ struct x {
|
||||||
};
|
};
|
||||||
struct x getX() {
|
struct x getX() {
|
||||||
}
|
}
|
||||||
|
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171520
|
||||||
|
int bug=sizeof(int);
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=169382
|
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=169382
|
||||||
struct x {};
|
struct x {};
|
||||||
struct x getX() {}
|
struct x getX() {}
|
||||||
|
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171520
|
||||||
|
int bug=sizeof(int);
|
||||||
|
|
|
@ -41,3 +41,21 @@ int foo(int bar) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end namespace FOO
|
} // end namespace FOO
|
||||||
|
/*
|
||||||
|
* Line Wrapping
|
||||||
|
*/
|
||||||
|
int array[]= { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1000,
|
||||||
|
2000, 3000, 4000, 5000 };
|
||||||
|
int compare(int argument, int otherArgument) {
|
||||||
|
return argument+otherArgument > argument*otherArgument+1000000 ? 100000+50000
|
||||||
|
: 200000-30000;
|
||||||
|
}
|
||||||
|
class Other {
|
||||||
|
static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6,
|
||||||
|
int arg7, int arg8, int arg9) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
void foo() {
|
||||||
|
Other::bar(100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000,
|
||||||
|
900000);
|
||||||
|
}
|
||||||
|
|
|
@ -3,3 +3,10 @@
|
||||||
*/
|
*/
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
class Point {public:Point(double xc, double yc) : x(xc), y(yc) {}double distance(const Point& other) const;int compareX(const Point& other) const;double x;double y;};double Point::distance(const Point& other) const {double dx = x - other.x;double dy = y - other.y;return sqrt(dx * dx + dy * dy);}int Point::compareX(const Point& other) const {if (x < other.x) {return -1;} else if (x > other.x) {return 1;} else {return 0;}}namespace FOO {int foo(int bar) const {switch (bar) {case 0:++bar;break;case 1:--bar;default: {bar += bar;break;}}}} // end namespace FOO
|
class Point {public:Point(double xc, double yc) : x(xc), y(yc) {}double distance(const Point& other) const;int compareX(const Point& other) const;double x;double y;};double Point::distance(const Point& other) const {double dx = x - other.x;double dy = y - other.y;return sqrt(dx * dx + dy * dy);}int Point::compareX(const Point& other) const {if (x < other.x) {return -1;} else if (x > other.x) {return 1;} else {return 0;}}namespace FOO {int foo(int bar) const {switch (bar) {case 0:++bar;break;case 1:--bar;default: {bar += bar;break;}}}} // end namespace FOO
|
||||||
|
/*
|
||||||
|
* Line Wrapping
|
||||||
|
*/
|
||||||
|
int array[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1000, 2000, 3000, 4000, 5000};
|
||||||
|
int compare(int argument, int otherArgument) {return argument+otherArgument > argument*otherArgument+1000000 ? 100000+50000 : 200000-30000;}
|
||||||
|
class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) {}};
|
||||||
|
void foo() {Other::bar(100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000);}
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
#include <Simple.h>
|
//#include <Simple.h>
|
||||||
|
#ifndef SIMPLE_H
|
||||||
|
#define SIMPLE_H
|
||||||
|
|
||||||
const SimpleStruct simpleStruct =
|
struct SimpleStruct {
|
||||||
{
|
int num;
|
||||||
1
|
char name[ ];
|
||||||
, "mySimple"
|
float floatNum;
|
||||||
, 0.1232
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void SimpleStruct_construct( struct SimpleStruct * const this );
|
||||||
|
|
||||||
|
int SimpleStruct_doSomething( const struct SimpleStruct * const this );
|
||||||
|
|
||||||
|
#endif /* SIMPLE_H */
|
||||||
|
|
||||||
|
const SimpleStruct simpleStruct = { 1, "mySimple", 0.1232 };
|
||||||
|
|
||||||
#define SIZEOF( A, B ) sizeof( A.B )
|
#define SIZEOF( A, B ) sizeof( A.B )
|
||||||
|
|
||||||
#define FOREVER \
|
#define FOREVER \
|
||||||
|
@ -15,25 +24,13 @@ const SimpleStruct simpleStruct =
|
||||||
\
|
\
|
||||||
}
|
}
|
||||||
|
|
||||||
const OtherStruct array[] =
|
const SimpleStruct array[] = { { SIZEOF( simpleStruct, num ),
|
||||||
{
|
|
||||||
{
|
|
||||||
#if FOO
|
#if FOO
|
||||||
"foo"
|
"foo"
|
||||||
# else
|
# else
|
||||||
"bar"
|
"bar"
|
||||||
#endif
|
#endif
|
||||||
, SIZEOF( simpleStruct, num )
|
, 0.5 }, { SIZEOF( simpleStruct, floatNum ), "name", 1.1 } };
|
||||||
, &t_int
|
|
||||||
, 0
|
|
||||||
}
|
|
||||||
, {
|
|
||||||
"name"
|
|
||||||
, SIZEOF( simpleStruct, floatnum )
|
|
||||||
, &t_float
|
|
||||||
, 1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// single line outside scope
|
// single line outside scope
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#include <Simple.h>
|
//#include <Simple.h>
|
||||||
|
#ifndef SIMPLE_H
|
||||||
|
#define SIMPLE_H
|
||||||
|
|
||||||
|
struct SimpleStruct
|
||||||
|
{
|
||||||
|
int num;
|
||||||
|
char name[ ];
|
||||||
|
float floatNum;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void SimpleStruct_construct( struct SimpleStruct * const this );
|
||||||
|
|
||||||
|
int SimpleStruct_doSomething( const struct SimpleStruct * const this );
|
||||||
|
|
||||||
|
#endif /* SIMPLE_H */
|
||||||
|
|
||||||
|
|
||||||
const SimpleStruct simpleStruct =
|
const SimpleStruct simpleStruct =
|
||||||
{
|
{
|
||||||
|
@ -15,23 +32,21 @@ const SimpleStruct simpleStruct =
|
||||||
\
|
\
|
||||||
}
|
}
|
||||||
|
|
||||||
const OtherStruct array[] =
|
const SimpleStruct array[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
SIZEOF( simpleStruct, num ),
|
||||||
#if FOO
|
#if FOO
|
||||||
"foo"
|
"foo"
|
||||||
# else
|
# else
|
||||||
"bar"
|
"bar"
|
||||||
#endif
|
#endif
|
||||||
, SIZEOF( simpleStruct, num )
|
, 0.5
|
||||||
, &t_int
|
|
||||||
, 0
|
|
||||||
}
|
}
|
||||||
, {
|
, {
|
||||||
"name"
|
SIZEOF( simpleStruct, floatNum )
|
||||||
, SIZEOF( simpleStruct, floatnum )
|
, "name"
|
||||||
, &t_float
|
, 1.1
|
||||||
, 1
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2006 IBM Corporation and others.
|
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -17,7 +17,6 @@ import java.util.ResourceBundle;
|
||||||
|
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.jface.action.IStatusLineManager;
|
|
||||||
import org.eclipse.jface.action.Separator;
|
import org.eclipse.jface.action.Separator;
|
||||||
import org.eclipse.jface.text.ITextOperationTarget;
|
import org.eclipse.jface.text.ITextOperationTarget;
|
||||||
import org.eclipse.ui.IActionBars;
|
import org.eclipse.ui.IActionBars;
|
||||||
|
@ -35,13 +34,13 @@ import org.eclipse.cdt.internal.ui.actions.GoToNextPreviousMemberAction;
|
||||||
|
|
||||||
public class CEditorActionContributor extends TextEditorActionContributor {
|
public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
|
|
||||||
protected CEditor fCEditor;
|
private RetargetTextEditorAction fContentAssist;
|
||||||
protected RetargetTextEditorAction fContentAssist;
|
private RetargetTextEditorAction fContextInformation;
|
||||||
protected RetargetTextEditorAction fFormatter;
|
private RetargetTextEditorAction fFormatter;
|
||||||
protected RetargetTextEditorAction fAddInclude;
|
private RetargetTextEditorAction fAddInclude;
|
||||||
// protected RetargetTextEditorAction fOpenOnSelection;
|
// private RetargetTextEditorAction fOpenOnSelection;
|
||||||
protected RetargetTextEditorAction fShiftLeft;
|
private RetargetTextEditorAction fShiftLeft;
|
||||||
protected RetargetTextEditorAction fShiftRight;
|
private RetargetTextEditorAction fShiftRight;
|
||||||
private TogglePresentationAction fTogglePresentation;
|
private TogglePresentationAction fTogglePresentation;
|
||||||
private GotoAnnotationAction fPreviousAnnotation;
|
private GotoAnnotationAction fPreviousAnnotation;
|
||||||
private GotoAnnotationAction fNextAnnotation;
|
private GotoAnnotationAction fNextAnnotation;
|
||||||
|
@ -49,6 +48,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
private RetargetTextEditorAction fGotoNextMemberAction;
|
private RetargetTextEditorAction fGotoNextMemberAction;
|
||||||
private RetargetTextEditorAction fGotoPreviousMemberAction;
|
private RetargetTextEditorAction fGotoPreviousMemberAction;
|
||||||
private RetargetTextEditorAction fToggleInsertModeAction;
|
private RetargetTextEditorAction fToggleInsertModeAction;
|
||||||
|
private RetargetTextEditorAction fShowOutline;
|
||||||
|
|
||||||
public CEditorActionContributor() {
|
public CEditorActionContributor() {
|
||||||
super();
|
super();
|
||||||
|
@ -66,6 +66,9 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
fContentAssist = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); //$NON-NLS-1$
|
fContentAssist = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); //$NON-NLS-1$
|
||||||
fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
|
fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
|
||||||
|
|
||||||
|
fContextInformation = new RetargetTextEditorAction(bundle, "ContentAssistContextInformation."); //$NON-NLS-1$
|
||||||
|
fContextInformation.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
|
||||||
|
|
||||||
fFormatter = new RetargetTextEditorAction(bundle, "Format."); //$NON-NLS-1$
|
fFormatter = new RetargetTextEditorAction(bundle, "Format."); //$NON-NLS-1$
|
||||||
fFormatter.setActionDefinitionId(ICEditorActionDefinitionIds.FORMAT);
|
fFormatter.setActionDefinitionId(ICEditorActionDefinitionIds.FORMAT);
|
||||||
|
|
||||||
|
@ -93,8 +96,11 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
|
|
||||||
fToggleInsertModeAction= new RetargetTextEditorAction(bundle, "ToggleInsertMode.", IAction.AS_CHECK_BOX); //$NON-NLS-1$
|
fToggleInsertModeAction= new RetargetTextEditorAction(bundle, "ToggleInsertMode.", IAction.AS_CHECK_BOX); //$NON-NLS-1$
|
||||||
fToggleInsertModeAction.setActionDefinitionId(ITextEditorActionDefinitionIds.TOGGLE_INSERT_MODE);
|
fToggleInsertModeAction.setActionDefinitionId(ITextEditorActionDefinitionIds.TOGGLE_INSERT_MODE);
|
||||||
}
|
|
||||||
|
|
||||||
|
fShowOutline= new RetargetTextEditorAction(bundle, "OpenOutline."); //$NON-NLS-1$
|
||||||
|
fShowOutline.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_OUTLINE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.texteditor.BasicTextEditorActionContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
|
* @see org.eclipse.ui.texteditor.BasicTextEditorActionContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
|
||||||
|
@ -105,18 +111,26 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
|
|
||||||
IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
|
IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
|
||||||
if (editMenu != null) {
|
if (editMenu != null) {
|
||||||
editMenu.add(fShiftRight);
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, fContentAssist);
|
||||||
editMenu.add(fShiftLeft);
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, fContextInformation);
|
||||||
|
|
||||||
editMenu.add(new Separator(IContextMenuConstants.GROUP_GENERATE));
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, fShiftRight);
|
||||||
editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fContentAssist);
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, fShiftLeft);
|
||||||
editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fAddInclude);
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, fFormatter);
|
||||||
editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fFormatter);
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, new Separator());
|
||||||
// editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fOpenOnSelection);
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, fAddInclude);
|
||||||
|
editMenu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, new Separator());
|
||||||
|
|
||||||
editMenu.appendToGroup(IContextMenuConstants.GROUP_ADDITIONS, fToggleInsertModeAction);
|
editMenu.appendToGroup(IContextMenuConstants.GROUP_ADDITIONS, fToggleInsertModeAction);
|
||||||
|
}
|
||||||
|
|
||||||
IMenuManager gotoMenu= menu.findMenuUsingPath("navigate/goTo"); //$NON-NLS-1$
|
IMenuManager navigateMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
|
||||||
|
if (navigateMenu != null) {
|
||||||
|
navigateMenu.appendToGroup(IWorkbenchActionConstants.SHOW_EXT, fShowOutline);
|
||||||
|
// navigateMenu.appendToGroup(IWorkbenchActionConstants.SHOW_EXT, fOpenHierarchy);
|
||||||
|
// navigateMenu.appendToGroup(IWorkbenchActionConstants.SHOW_EXT, fOpenOnSelection);
|
||||||
|
|
||||||
|
IMenuManager gotoMenu= navigateMenu.findMenuUsingPath(IWorkbenchActionConstants.GO_TO);
|
||||||
if (gotoMenu != null) {
|
if (gotoMenu != null) {
|
||||||
gotoMenu.add(new Separator("additions2")); //$NON-NLS-1$
|
gotoMenu.add(new Separator("additions2")); //$NON-NLS-1$
|
||||||
gotoMenu.appendToGroup("additions2", fGotoPreviousMemberAction); //$NON-NLS-1$
|
gotoMenu.appendToGroup("additions2", fGotoPreviousMemberAction); //$NON-NLS-1$
|
||||||
|
@ -124,6 +138,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
gotoMenu.appendToGroup("additions2", fGotoMatchingBracket); //$NON-NLS-1$
|
gotoMenu.appendToGroup("additions2", fGotoMatchingBracket); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +155,6 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
|
bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.editors.text.TextEditorActionContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
|
* @see org.eclipse.ui.editors.text.TextEditorActionContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
|
||||||
*/
|
*/
|
||||||
|
@ -160,6 +174,7 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
fNextAnnotation.setEditor(textEditor);
|
fNextAnnotation.setEditor(textEditor);
|
||||||
|
|
||||||
fContentAssist.setAction(getAction(textEditor, "ContentAssistProposal")); //$NON-NLS-1$
|
fContentAssist.setAction(getAction(textEditor, "ContentAssistProposal")); //$NON-NLS-1$
|
||||||
|
fContextInformation.setAction(getAction(textEditor, "ContentAssistContextInformation")); //$NON-NLS-1$
|
||||||
fAddInclude.setAction(getAction(textEditor, "AddIncludeOnSelection")); //$NON-NLS-1$
|
fAddInclude.setAction(getAction(textEditor, "AddIncludeOnSelection")); //$NON-NLS-1$
|
||||||
// fOpenOnSelection.setAction(getAction(textEditor, "OpenOnSelection")); //$NON-NLS-1$
|
// fOpenOnSelection.setAction(getAction(textEditor, "OpenOnSelection")); //$NON-NLS-1$
|
||||||
fFormatter.setAction(getAction(textEditor, "Format")); //$NON-NLS-1$
|
fFormatter.setAction(getAction(textEditor, "Format")); //$NON-NLS-1$
|
||||||
|
@ -168,6 +183,8 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
fGotoNextMemberAction.setAction(getAction(textEditor, GoToNextPreviousMemberAction.NEXT_MEMBER));
|
fGotoNextMemberAction.setAction(getAction(textEditor, GoToNextPreviousMemberAction.NEXT_MEMBER));
|
||||||
fGotoPreviousMemberAction.setAction(getAction(textEditor, GoToNextPreviousMemberAction.PREVIOUS_MEMBER));
|
fGotoPreviousMemberAction.setAction(getAction(textEditor, GoToNextPreviousMemberAction.PREVIOUS_MEMBER));
|
||||||
|
|
||||||
|
fShowOutline.setAction(getAction(textEditor, "OpenOutline")); //$NON-NLS-1$
|
||||||
|
|
||||||
fToggleInsertModeAction.setAction(getAction(textEditor, ITextEditorActionConstants.TOGGLE_INSERT_MODE));
|
fToggleInsertModeAction.setAction(getAction(textEditor, ITextEditorActionConstants.TOGGLE_INSERT_MODE));
|
||||||
|
|
||||||
if (part instanceof CEditor) {
|
if (part instanceof CEditor) {
|
||||||
|
@ -177,15 +194,6 @@ public class CEditorActionContributor extends TextEditorActionContributor {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see EditorActionBarContributor#contributeToStatusLine(IStatusLineManager)
|
|
||||||
*
|
|
||||||
* More code here only until we move to 2.0...
|
|
||||||
*/
|
|
||||||
public void contributeeToStatusLine(IStatusLineManager statusLineManager) {
|
|
||||||
super.contributeToStatusLine(statusLineManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.IEditorActionBarContributor#dispose()
|
* @see org.eclipse.ui.IEditorActionBarContributor#dispose()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#########################################
|
#########################################
|
||||||
# Copyright (c) 2005, 2006 IBM Corporation and others.
|
# Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
# which accompanies this distribution, and is available at
|
# which accompanies this distribution, and is available at
|
||||||
|
@ -59,6 +59,10 @@ ContentAssistProposal.label=Co&ntent Assist
|
||||||
ContentAssistProposal.tooltip=Content Assist
|
ContentAssistProposal.tooltip=Content Assist
|
||||||
ContentAssistProposal.description=Content Assist
|
ContentAssistProposal.description=Content Assist
|
||||||
|
|
||||||
|
ContentAssistContextInformation.label=Parameter &Hints
|
||||||
|
ContentAssistContextInformation.tooltip=Show Parameter Hints
|
||||||
|
ContentAssistContextInformation.description=Show Method Parameter Hints
|
||||||
|
|
||||||
ToggleComment.label=Comment/Uncomment
|
ToggleComment.label=Comment/Uncomment
|
||||||
ToggleComment.tooltip=Comment/Uncomment For the Selected Lines
|
ToggleComment.tooltip=Comment/Uncomment For the Selected Lines
|
||||||
ToggleComment.description=Comment/Uncomment for the selected lines
|
ToggleComment.description=Comment/Uncomment for the selected lines
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 IBM Corporation and others.
|
* Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,7 +12,10 @@
|
||||||
package org.eclipse.cdt.internal.ui.preferences.formatter;
|
package org.eclipse.cdt.internal.ui.preferences.formatter;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Observable;
|
||||||
|
import java.util.Observer;
|
||||||
|
|
||||||
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
|
|
||||||
|
@ -126,24 +129,24 @@ public class BracesTabPage extends ModifyDialogTabPage {
|
||||||
createExtendedBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_blocks_in_case, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE);
|
createExtendedBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_blocks_in_case, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE);
|
||||||
createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_switch_case, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH);
|
createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_switch_case, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH);
|
||||||
|
|
||||||
// ComboPreference arrayInitOption= createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_array_initializer, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER);
|
ComboPreference arrayInitOption= createBracesCombo(group, numColumns, FormatterMessages.BracesTabPage_option_array_initializer, DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER);
|
||||||
// final CheckboxPreference arrayInitCheckBox= createIndentedCheckboxPref(group, numColumns, FormatterMessages.BracesTabPage_option_keep_empty_array_initializer_on_one_line, DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, FALSE_TRUE);
|
final CheckboxPreference arrayInitCheckBox= createIndentedCheckboxPref(group, numColumns, FormatterMessages.BracesTabPage_option_keep_empty_array_initializer_on_one_line, DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, FALSE_TRUE);
|
||||||
|
|
||||||
// arrayInitOption.addObserver(new Observer() {
|
arrayInitOption.addObserver(new Observer() {
|
||||||
// public void update(Observable o, Object arg) {
|
public void update(Observable o, Object arg) {
|
||||||
// updateOptionEnablement((ComboPreference) o, arrayInitCheckBox);
|
updateOptionEnablement((ComboPreference) o, arrayInitCheckBox);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// updateOptionEnablement(arrayInitOption, arrayInitCheckBox);
|
updateOptionEnablement(arrayInitOption, arrayInitCheckBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @param arrayInitOption
|
* @param arrayInitOption
|
||||||
// * @param arrayInitCheckBox
|
* @param arrayInitCheckBox
|
||||||
// */
|
*/
|
||||||
// protected final void updateOptionEnablement(ComboPreference arrayInitOption, CheckboxPreference arrayInitCheckBox) {
|
protected final void updateOptionEnablement(ComboPreference arrayInitOption, CheckboxPreference arrayInitCheckBox) {
|
||||||
// arrayInitCheckBox.setEnabled(!arrayInitOption.hasValue(DefaultCodeFormatterConstants.END_OF_LINE));
|
arrayInitCheckBox.setEnabled(!arrayInitOption.hasValue(DefaultCodeFormatterConstants.END_OF_LINE));
|
||||||
// }
|
}
|
||||||
|
|
||||||
protected void initializePage() {
|
protected void initializePage() {
|
||||||
fPreview.setPreviewText(PREVIEW);
|
fPreview.setPreviewText(PREVIEW);
|
||||||
|
@ -162,12 +165,12 @@ public class BracesTabPage extends ModifyDialogTabPage {
|
||||||
return createComboPref(composite, numColumns, message, key, fExtendedBracePositions, fExtendedBracePositionNames);
|
return createComboPref(composite, numColumns, message, key, fExtendedBracePositions, fExtendedBracePositionNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
// private CheckboxPreference createIndentedCheckboxPref(Composite composite, int numColumns, String message, String key, String [] values) {
|
private CheckboxPreference createIndentedCheckboxPref(Composite composite, int numColumns, String message, String key, String [] values) {
|
||||||
// CheckboxPreference pref= createCheckboxPref(composite, numColumns, message, key, values);
|
CheckboxPreference pref= createCheckboxPref(composite, numColumns, message, key, values);
|
||||||
// GridData data= (GridData) pref.getControl().getLayoutData();
|
GridData data= (GridData) pref.getControl().getLayoutData();
|
||||||
// data.horizontalIndent= fPixelConverter.convertWidthInCharsToPixels(1);
|
data.horizontalIndent= fPixelConverter.convertWidthInCharsToPixels(1);
|
||||||
// return pref;
|
return pref;
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void doUpdatePreview() {
|
protected void doUpdatePreview() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 IBM Corporation and others.
|
* Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -299,7 +299,7 @@ final class FormatterMessages extends NLS {
|
||||||
public static String LineWrappingTabPage_width_indent;
|
public static String LineWrappingTabPage_width_indent;
|
||||||
public static String LineWrappingTabPage_width_indent_option_max_line_width;
|
public static String LineWrappingTabPage_width_indent_option_max_line_width;
|
||||||
public static String LineWrappingTabPage_width_indent_option_default_indent_wrapped;
|
public static String LineWrappingTabPage_width_indent_option_default_indent_wrapped;
|
||||||
// public static String LineWrappingTabPage_width_indent_option_default_indent_array;
|
public static String LineWrappingTabPage_width_indent_option_default_indent_array;
|
||||||
public static String LineWrappingTabPage_error_invalid_value;
|
public static String LineWrappingTabPage_error_invalid_value;
|
||||||
// public static String LineWrappingTabPage_enum_superinterfaces;
|
// public static String LineWrappingTabPage_enum_superinterfaces;
|
||||||
// public static String LineWrappingTabPage_assignment_alignment;
|
// public static String LineWrappingTabPage_assignment_alignment;
|
||||||
|
@ -338,8 +338,8 @@ final class FormatterMessages extends NLS {
|
||||||
public static String BracesTabPage_option_blocks;
|
public static String BracesTabPage_option_blocks;
|
||||||
public static String BracesTabPage_option_blocks_in_case;
|
public static String BracesTabPage_option_blocks_in_case;
|
||||||
public static String BracesTabPage_option_switch_case;
|
public static String BracesTabPage_option_switch_case;
|
||||||
// public static String BracesTabPage_option_array_initializer;
|
public static String BracesTabPage_option_array_initializer;
|
||||||
// public static String BracesTabPage_option_keep_empty_array_initializer_on_one_line;
|
public static String BracesTabPage_option_keep_empty_array_initializer_on_one_line;
|
||||||
// public static String BracesTabPage_option_enum_declaration;
|
// public static String BracesTabPage_option_enum_declaration;
|
||||||
// public static String BracesTabPage_option_enumconst_declaration;
|
// public static String BracesTabPage_option_enumconst_declaration;
|
||||||
// public static String BracesTabPage_option_annotation_type_declaration;
|
// public static String BracesTabPage_option_annotation_type_declaration;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Copyright (c) 2000, 2006 IBM Corporation and others.
|
# Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
# which accompanies this distribution, and is available at
|
# which accompanies this distribution, and is available at
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
# istvan@benedek-home.de - 103706 [formatter] indent empty lines
|
# istvan@benedek-home.de - 103706 [formatter] indent empty lines
|
||||||
# Aaron Luchko, aluchko@redhat.com - 105926 [Formatter] Exporting Unnamed profile fails silently
|
# Aaron Luchko, aluchko@redhat.com - 105926 [Formatter] Exporting Unnamed profile fails silently
|
||||||
# Sergey Prigogin, Google
|
# Sergey Prigogin, Google
|
||||||
|
# Anton Leherbauer (Wind River Systems)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@
|
||||||
#WhiteSpaceTabPage_localvars_before_comma=before comma in multiple local declarations
|
#WhiteSpaceTabPage_localvars_before_comma=before comma in multiple local declarations
|
||||||
#WhiteSpaceTabPage_localvars_after_comma=after comma in multiple local declarations
|
#WhiteSpaceTabPage_localvars_after_comma=after comma in multiple local declarations
|
||||||
|
|
||||||
#WhiteSpaceTabPage_arrayinit=Array initializers
|
#WhiteSpaceTabPage_arrayinit=Initializer lists
|
||||||
#WhiteSpaceTabPage_arraydecls=Array declarations
|
#WhiteSpaceTabPage_arraydecls=Array declarations
|
||||||
#WhiteSpaceTabPage_arrayelem=Array element access
|
#WhiteSpaceTabPage_arrayelem=Array element access
|
||||||
#WhiteSpaceTabPage_arrayalloc=Array allocation
|
#WhiteSpaceTabPage_arrayalloc=Array allocation
|
||||||
|
@ -216,13 +217,13 @@
|
||||||
#WhiteSpaceOptions_closing_bracket=Closing bracket
|
#WhiteSpaceOptions_closing_bracket=Closing bracket
|
||||||
#WhiteSpaceOptions_class_decl=Type declaration
|
#WhiteSpaceOptions_class_decl=Type declaration
|
||||||
#WhiteSpaceOptions_anon_class_decl=Anonymous type declaration
|
#WhiteSpaceOptions_anon_class_decl=Anonymous type declaration
|
||||||
#WhiteSpaceOptions_initializer=Array initializer
|
#WhiteSpaceOptions_initializer=Initializer lists
|
||||||
#WhiteSpaceOptions_block=Block
|
#WhiteSpaceOptions_block=Block
|
||||||
|
|
||||||
#WhiteSpaceOptions_array_decl=Array declaration
|
#WhiteSpaceOptions_array_decl=Array declaration
|
||||||
#WhiteSpaceOptions_array_element_access=Array element access
|
#WhiteSpaceOptions_array_element_access=Array element access
|
||||||
#WhiteSpaceOptions_array_alloc=Array allocation
|
#WhiteSpaceOptions_array_alloc=Array allocation
|
||||||
#WhiteSpaceOptions_array_init=Array initializer
|
#WhiteSpaceOptions_array_init=Initializer list
|
||||||
|
|
||||||
#WhiteSpaceOptions_arguments=Arguments
|
#WhiteSpaceOptions_arguments=Arguments
|
||||||
#WhiteSpaceOptions_initialization=Initialization
|
#WhiteSpaceOptions_initialization=Initialization
|
||||||
|
@ -308,7 +309,7 @@ LineWrappingTabPage_arguments=Arguments
|
||||||
#LineWrappingTabPage_throws_clause='throws' clause
|
#LineWrappingTabPage_throws_clause='throws' clause
|
||||||
#LineWrappingTabPage_object_allocation=Object allocation arguments
|
#LineWrappingTabPage_object_allocation=Object allocation arguments
|
||||||
#LineWrappingTabPage_qualified_object_allocation=Qualified object allocation arguments
|
#LineWrappingTabPage_qualified_object_allocation=Qualified object allocation arguments
|
||||||
LineWrappingTabPage_array_init=Array initializers
|
LineWrappingTabPage_array_init=Initializer lists
|
||||||
#LineWrappingTabPage_explicit_constructor_invocations=Explicit constructor invocations
|
#LineWrappingTabPage_explicit_constructor_invocations=Explicit constructor invocations
|
||||||
LineWrappingTabPage_conditionals=Conditionals
|
LineWrappingTabPage_conditionals=Conditionals
|
||||||
#LineWrappingTabPage_binary_exprs=Binary expressions
|
#LineWrappingTabPage_binary_exprs=Binary expressions
|
||||||
|
@ -340,7 +341,7 @@ LineWrappingTabPage_splitting_wrap_always_except_first_only_if_necessary=Wrap al
|
||||||
LineWrappingTabPage_width_indent=Line width and indentation levels
|
LineWrappingTabPage_width_indent=Line width and indentation levels
|
||||||
LineWrappingTabPage_width_indent_option_max_line_width=Ma&ximum line width:
|
LineWrappingTabPage_width_indent_option_max_line_width=Ma&ximum line width:
|
||||||
LineWrappingTabPage_width_indent_option_default_indent_wrapped=Defa&ult indentation for wrapped lines:
|
LineWrappingTabPage_width_indent_option_default_indent_wrapped=Defa&ult indentation for wrapped lines:
|
||||||
#LineWrappingTabPage_width_indent_option_default_indent_array=Default indentation for arra&y initializers:
|
LineWrappingTabPage_width_indent_option_default_indent_array=Default indentation for nitializer lists:
|
||||||
LineWrappingTabPage_error_invalid_value=The key ''{0}'' contained an invalid value; resetting to defaults.
|
LineWrappingTabPage_error_invalid_value=The key ''{0}'' contained an invalid value; resetting to defaults.
|
||||||
#LineWrappingTabPage_enum_superinterfaces='implements' clause
|
#LineWrappingTabPage_enum_superinterfaces='implements' clause
|
||||||
#LineWrappingTabPage_assignment_alignment=Assignments
|
#LineWrappingTabPage_assignment_alignment=Assignments
|
||||||
|
@ -387,8 +388,8 @@ BracesTabPage_option_method_declaration=Met&hod declaration:
|
||||||
BracesTabPage_option_blocks=&Blocks:
|
BracesTabPage_option_blocks=&Blocks:
|
||||||
BracesTabPage_option_blocks_in_case=Bloc&ks in case statement:
|
BracesTabPage_option_blocks_in_case=Bloc&ks in case statement:
|
||||||
BracesTabPage_option_switch_case='&switch' statement:
|
BracesTabPage_option_switch_case='&switch' statement:
|
||||||
#BracesTabPage_option_array_initializer=Array initiali&zer:
|
BracesTabPage_option_array_initializer=Initiali&zer list:
|
||||||
#BracesTabPage_option_keep_empty_array_initializer_on_one_line=Keep empty array &initializer on one line
|
BracesTabPage_option_keep_empty_array_initializer_on_one_line=Keep empty &initializer list on one line
|
||||||
#BracesTabPage_option_enum_declaration=&Enum declaration:
|
#BracesTabPage_option_enum_declaration=&Enum declaration:
|
||||||
#BracesTabPage_option_enumconst_declaration=Enum c&onstant body:
|
#BracesTabPage_option_enumconst_declaration=Enum c&onstant body:
|
||||||
#BracesTabPage_option_annotation_type_declaration=&Annotation type declaration:
|
#BracesTabPage_option_annotation_type_declaration=&Annotation type declaration:
|
||||||
|
@ -536,9 +537,9 @@ ModifyDialogTabPage_NumberPreference_error_invalid_value=Invalid value: Please e
|
||||||
#NewLinesTabPage_empty_statement_group_title=Empty statements
|
#NewLinesTabPage_empty_statement_group_title=Empty statements
|
||||||
#NewLinesTabPage_emtpy_statement_group_option_empty_statement_on_new_line=Put empty &statement on new line
|
#NewLinesTabPage_emtpy_statement_group_option_empty_statement_on_new_line=Put empty &statement on new line
|
||||||
|
|
||||||
#NewLinesTabPage_arrayInitializer_group_title=Array initializers
|
#NewLinesTabPage_arrayInitializer_group_title=Initializer lists
|
||||||
#NewLinesTabPage_array_group_option_after_opening_brace_of_array_initializer=Insert new line after openin&g brace of array initializer
|
#NewLinesTabPage_array_group_option_after_opening_brace_of_array_initializer=Insert new line after openin&g brace of initializer list
|
||||||
#NewLinesTabPage_array_group_option_before_closing_brace_of_array_initializer=Insert new line before closing brace of array initiali&zer
|
#NewLinesTabPage_array_group_option_before_closing_brace_of_array_initializer=Insert new line before closing brace of initiali&zer list
|
||||||
|
|
||||||
#NewLinesTabPage_annotations_group_title=Annotations
|
#NewLinesTabPage_annotations_group_title=Annotations
|
||||||
#NewLinesTabPage_annotations_group_option_after_annotation=&Insert new line after annotations
|
#NewLinesTabPage_annotations_group_option_after_annotation=&Insert new line after annotations
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 IBM Corporation and others.
|
* Copyright (c) 2000, 2007 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -392,7 +392,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage {
|
||||||
|
|
||||||
private final Category fMessageSendArgumentsCategory= new Category(
|
private final Category fMessageSendArgumentsCategory= new Category(
|
||||||
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
|
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
|
||||||
"class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) {}};"+ //$NON-NLS-1$
|
"class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) {}};"+ //$NON-NLS-1$
|
||||||
"void foo() {Other::bar(100, 200, 300, 400, 500, 600, 700, 800, 900);}", //$NON-NLS-1$
|
"void foo() {Other::bar(100, 200, 300, 400, 500, 600, 700, 800, 900);}", //$NON-NLS-1$
|
||||||
FormatterMessages.LineWrappingTabPage_arguments
|
FormatterMessages.LineWrappingTabPage_arguments
|
||||||
);
|
);
|
||||||
|
@ -434,7 +434,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage {
|
||||||
|
|
||||||
private final Category fArrayInitializerExpressionsCategory= new Category(
|
private final Category fArrayInitializerExpressionsCategory= new Category(
|
||||||
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
|
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
|
||||||
"int[] array= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};", //$NON-NLS-1$
|
"int array[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};", //$NON-NLS-1$
|
||||||
FormatterMessages.LineWrappingTabPage_array_init
|
FormatterMessages.LineWrappingTabPage_array_init
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage {
|
||||||
|
|
||||||
private final Category fConditionalExpressionCategory= new Category(
|
private final Category fConditionalExpressionCategory= new Category(
|
||||||
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
|
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
|
||||||
"int example(bool argument0, int otherArgument) {return argument ? 100000 : 200000;}}", //$NON-NLS-1$
|
"int compare(int argument, int otherArgument) {return argument > argument ? 100000 : 200000;}", //$NON-NLS-1$
|
||||||
FormatterMessages.LineWrappingTabPage_conditionals
|
FormatterMessages.LineWrappingTabPage_conditionals
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage {
|
||||||
root.add(methodDeclarations);
|
root.add(methodDeclarations);
|
||||||
// root.add(enumDeclarations);
|
// root.add(enumDeclarations);
|
||||||
root.add(functionCalls);
|
root.add(functionCalls);
|
||||||
// root.add(expressions);
|
root.add(expressions);
|
||||||
// root.add(statements);
|
// root.add(statements);
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
|
@ -630,7 +630,7 @@ public class LineWrappingTabPage extends ModifyDialogTabPage {
|
||||||
|
|
||||||
createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_max_line_width, DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, 0, 9999);
|
createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_max_line_width, DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, 0, 9999);
|
||||||
createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_wrapped, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, 0, 9999);
|
createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_wrapped, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, 0, 9999);
|
||||||
// createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_array, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, 0, 9999);
|
createNumberPref(lineWidthGroup, numColumns, FormatterMessages.LineWrappingTabPage_width_indent_option_default_indent_array, DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, 0, 9999);
|
||||||
|
|
||||||
fCategoriesViewer= new TreeViewer(composite /*categoryGroup*/, SWT.MULTI | SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL );
|
fCategoriesViewer= new TreeViewer(composite /*categoryGroup*/, SWT.MULTI | SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL );
|
||||||
fCategoriesViewer.setContentProvider(new ITreeContentProvider() {
|
fCategoriesViewer.setContentProvider(new ITreeContentProvider() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue