diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java index a990341e856..f373e9e8037 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java @@ -141,6 +141,26 @@ public class CCorePlugin extends Plugin { */ public final static String CONTENT_TYPE_ASMSOURCE = "org.eclipse.cdt.core.asmSource"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String INSERT = "insert"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String DO_NOT_INSERT = "do not insert"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String TAB = "tab"; //$NON-NLS-1$ + /** + * Possible configurable option value. + * @see #getDefaultOptions() + */ + public static final String SPACE = "space"; //$NON-NLS-1$ public CDTLogWriter cdtLog = null; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java index 0f3f1b87558..0401c9b43ae 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java @@ -7,20 +7,24 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Sergey Prigogin, Google *******************************************************************************/ package org.eclipse.cdt.core.formatter; +import java.util.Map; + import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.internal.formatter.DefaultCodeFormatterOptions; +import org.eclipse.cdt.internal.formatter.align.Alignment; /** */ public class CodeFormatterConstants { - /** *
* FORMATTER / Option for alignment of arguments in allocation expression
- * - option id: "org.eclipse.jdt.core.formatter.language"
+ * - option id: "org.eclipse.cdt.core.formatter.language"
* - possible values: values proposed in class ParserLanguage
* - default: ParserLanguage.CPP
*
@@ -30,13 +34,3062 @@ public class CodeFormatterConstants {
/**
* * FORMATTER / Option for alignment of arguments in allocation expression - * - option id: "org.eclipse.jdt.core.formatter.current_file" + * - option id: "org.eclipse.cdt.core.formatter.current_file" * - possible values: object of class*/ public static final String FORMATTER_CURRENT_FILE = CCorePlugin.PLUGIN_ID + ".formatter.current_file"; //$NON-NLS-1$ - + /** + *IFile
ornull
* - default: null *
+ * FORMATTER / Value to set a brace location at the end of a line. + *+ * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION + * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER + * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK + * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION + * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION + * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH + * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION + */ + public static final String END_OF_LINE = "end_of_line"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Value to set an option to false. + *+ */ + public static final String FALSE = "false"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option to align type members of a type declaration on column + * - option id: "org.eclipse.cdt.core.formatter.formatter.align_type_members_on_columns" + * - possible values: { TRUE, FALSE } + * - default: FALSE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS = CCorePlugin.PLUGIN_ID + ".formatter.align_type_members_on_columns"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option for alignment of arguments in allocation expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_allocation_expression"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_allocation_expression"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of arguments in enum constant
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_enum_constant"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_enum_constant"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of arguments in explicit constructor call
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_explicit_constructor_call"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of arguments in method invocation
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_method_invocation"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of arguments in qualified allocation expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_qualified_allocation_expression"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of assignment
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_assignment"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, M_NO_ALIGNMENT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ASSIGNMENT = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_assignment"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of binary expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_binary_expression"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_binary_expression"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of compact if
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_compact_if"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_BY_ONE)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_COMPACT_IF = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_compact_if"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of conditional expression
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_conditional_expression"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_conditional_expression"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of enum constants
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_enum_constants"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_NO_SPLIT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_enum_constants"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of expressions in array initializer
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_expressions_in_array_initializer"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of multiple fields
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_multiple_fields"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_multiple_fields";//$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of parameters in constructor declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_constructor_declaration"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of parameters in method declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_method_declaration"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of selector in method invocation
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_selector_in_method_invocation"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_selector_in_method_invocation"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of superclass in type declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_superclass_in_type_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_NEXT_SHIFTED, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superclass_in_type_declaration"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of superinterfaces in enum declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superinterfaces_in_enum_declaration"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of superinterfaces in type declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superinterfaces_in_type_declaration"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of throws clause in constructor declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_constructor_declaration"; //$NON-NLS-1$
+ /**
+ *
+ * FORMATTER / Option for alignment of throws clause in method declaration
+ * - option id: "org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
+ * - possible values: values returned by createAlignmentValue(boolean, int, int)
call
+ * - default: createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
+ *
+ * @see #createAlignmentValue(boolean, int, int)
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_method_declaration"; //$NON-NLS-1$
+
+// /**
+// * +// * FORMATTER / Option to add blank lines after the imports declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_after_imports" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_AFTER_IMPORTS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_imports"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines after the package declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_after_package" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_AFTER_PACKAGE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_package"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines at the beginning of the method body +// * - option id: "org.eclipse.cdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.number_of_blank_lines_at_beginning_of_method_body"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before a field declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_field" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_field"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before the first class body declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_first_class_body_declaration" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_first_class_body_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before the imports declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_imports" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_IMPORTS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_imports"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before a member type declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_member_type" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_member_type"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_method" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_method"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before a new chunk +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_new_chunk" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines before the package declaration +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_before_package" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BEFORE_PACKAGE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_package"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to add blank lines between type declarations +// * - option id: "org.eclipse.cdt.core.formatter.blank_lines_between_type_declarations" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_between_type_declarations"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option to position the braces of an annotation type declaration + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_annotation_type_declaration" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_array_initializer"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of a block + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_block" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of a block in a case statement when the block is the first statement following + * the case + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_block_in_case" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block_in_case"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of a constructor declaration + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_constructor_declaration" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_constructor_declaration"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of an enum constant + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_enum_constant" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_constant"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of an enum declaration + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_enum_declaration" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_declaration"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of a method declaration + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_method_declaration" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_method_declaration"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of a switch statement + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_switch" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_switch"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to position the braces of a type declaration + * - option id: "org.eclipse.cdt.core.formatter.brace_position_for_type_declaration" + * - possible values: { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP } + * - default: END_OF_LINE + *+ * @see #END_OF_LINE + * @see #NEXT_LINE + * @see #NEXT_LINE_SHIFTED + * @see #NEXT_LINE_ON_WRAP + */ + public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_type_declaration"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to control whether blank lines are cleared inside comments +// * - option id: "org.eclipse.cdt.core.formatter.comment.clear_blank_lines" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES = CCorePlugin.PLUGIN_ID + ".formatter.comment.clear_blank_lines"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to control whether comments are formatted +// * - option id: "org.eclipse.cdt.core.formatter.comment.format_comments" +// * - possible values: { TRUE, FALSE } +// * - default: TRUE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public final static String FORMATTER_COMMENT_FORMAT = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_comments"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to control whether the header comment of a C/C++ source file is formatted +// * - option id: "org.eclipse.cdt.core.formatter.comment.format_header" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public final static String FORMATTER_COMMENT_FORMAT_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_header"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to control whether HTML tags are formatted. +// * - option id: "org.eclipse.cdt.core.formatter.comment.format_html" +// * - possible values: { TRUE, FALSE } +// * - default: TRUE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public final static String FORMATTER_COMMENT_FORMAT_HTML = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_html"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to control whether code snippets are formatted in comments +// * - option id: "org.eclipse.cdt.core.formatter.comment.format_source_code" +// * - possible values: { TRUE, FALSE } +// * - default: TRUE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public final static String FORMATTER_COMMENT_FORMAT_SOURCE = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_source_code"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to specify the line length for comments. +// * - option id: "org.eclipse.cdt.core.formatter.comment.line_length" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "80" +// *+// */ +// public final static String FORMATTER_COMMENT_LINE_LENGTH = CCorePlugin.PLUGIN_ID + ".formatter.comment.line_length"; //$NON-NLS-1$ + +// /** +// *
+// * FORMATTER / Option to compact else/if +// * - option id: "org.eclipse.cdt.core.formatter.compact_else_if" +// * - possible values: { TRUE, FALSE } +// * - default: TRUE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public static final String FORMATTER_COMPACT_ELSE_IF = CCorePlugin.PLUGIN_ID + ".formatter.compact_else_if"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option to set the continuation indentation + * - option id: "org.eclipse.cdt.core.formatter.continuation_indentation" + * - possible values: "<n>", where n is zero or a positive integer + * - default: "2" + *+ */ + public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to set the continuation indentation inside 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 + * - default: "2" + *+ */ + public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent body declarations compare to its enclosing annotation declaration header + * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_annotation_declaration_header"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header + * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_enum_constant_header"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent body declarations compare to its enclosing enum declaration header + * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_enum_declaration_header"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent body declarations compare to its enclosing type header + * - option id: "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_type_header" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_type_header"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent breaks compare to cases + * - option id: "org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_breaks_compare_to_cases"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent empty lines + * - option id: "org.eclipse.cdt.core.formatter.indent_empty_lines" + * - possible values: { TRUE, FALSE } + * - default: FALSE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_EMPTY_LINES = CCorePlugin.PLUGIN_ID + ".formatter.indent_empty_lines"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent statements inside a block + * - option id: "org.eclipse.cdt.core.formatter.indent_statements_compare_to_block" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.indent_statements_compare_to_block"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent statements inside the body of a method or a constructor + * - option id: "org.eclipse.cdt.core.formatter.indent_statements_compare_to_body" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY = CCorePlugin.PLUGIN_ID + ".formatter.indent_statements_compare_to_body"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent switch statements compare to cases + * - option id: "org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_cases"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to indent switch statements compare to switch + * - option id: "org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch" + * - possible values: { TRUE, FALSE } + * - default: TRUE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_switch"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation + * - option id: "org.eclipse.cdt.core.formatter.indentation.size" + * - possible values: "<n>", where n is zero or a positive integer + * - default: "4" + *+ *
This option is used only if the tab char is set to MIXED. + *
+ * @see #FORMATTER_TAB_CHAR + */ + public static final String FORMATTER_INDENTATION_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.indentation.size"; //$NON-NLS-1$ + +// /** +// *+// * FORMATTER / Option to insert a new line after an annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_after_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_annotation";//$NON-NLS-1$ +// +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// +// /** +// *
+// * FORMATTER / Option to insert a new line at the end of the current file if missing +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_at_end_of_file_if_missing";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line before the catch keyword in try statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a new line before the else keyword in if statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_else_in_if_statement"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line before the finally keyword in try statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_finally_in_try_statement" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_finally_in_try_statement"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line before while in do statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_while_in_do_statement"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty annotation declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_annotation_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_annotation_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty anonymous type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_anonymous_type_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty block +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_constant" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_constant"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty enum declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty method body +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_method_body" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_method_body"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a new line in an empty type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_type_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after and in wilcard +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_and_in_type_parameter" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_and_in_type_parameter"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after an assignment operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_assignment_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after at in annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_at_in_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_at_in_annotation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after at in annotation type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_at_in_annotation_type_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after a binary operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_binary_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_binary_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the closing angle bracket in type arguments +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_type_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the closing angle bracket in type parameters +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_type_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the closing brace of a block +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_brace_in_block"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the closing parenthesis of a cast expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_paren_in_cast"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the colon in an assert statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_assert" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_assert"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after colon in a case statement when a opening brace follows the colon +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_case"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the colon in a conditional expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_conditional"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after colon in a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the colon in a labeled statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_labeled_statement"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in an allocation expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_allocation_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_allocation_expression"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the parameters of a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_constructor_declaration_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the exception names in a throws clause of a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_constructor_declaration_throws"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the arguments of an enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_constant_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in enum declarations +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_declarations"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the arguments of an explicit constructor call +// * - option id: "org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the increments of a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_increments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_increments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the initializations of a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_inits" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_inits"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the parameters of a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_declaration_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the exception names in a throws clause of a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_declaration_throws"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in the arguments of a method invocation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_invocation_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in multiple field declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_multiple_field_declarations"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in multiple local declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_multiple_local_declarations"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in parameterized type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_parameterized_type_reference"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in superinterfaces names of a type header +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_superinterfaces" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_superinterfaces"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in type arguments +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_type_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_type_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the comma in type parameters +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_type_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_type_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after ellipsis +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_ellipsis" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_ellipsis"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening angle bracket in parameterized type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening angle bracket in type arguments +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_arguments";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening angle bracket in type parameters +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening bracket inside an array allocation expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket_in_array_allocation_expression";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening bracket inside an array reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket_in_array_reference";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_annotation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a cast expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_cast"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a catch +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_catch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_constructor_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_enum_constant"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in an if statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_if"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a method invocation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_invocation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a parenthesized expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a switch statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_switch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a synchronized statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_synchronized" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_synchronized"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after the opening parenthesis in a while statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_while"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after a postfix operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_postfix_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after a prefix operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_prefix_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after question mark in a conditional expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_question_in_conditional"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after question mark in a wildcard +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_question_in_wildcard" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_question_in_wildcard"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after semicolon in a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_semicolon_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space after an unary operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_after_unary_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_unary_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before and in wildcard +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_and_in_type_parameter" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_and_in_type_parameter"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before an assignment operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_assignment_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before at in annotation type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_at_in_annotation_type_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before an binary operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_binary_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_binary_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing angle bracket in parameterized type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing angle bracket in type arguments +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing angle bracket in type parameters +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing bracket in an array allocation expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket_in_array_allocation_expression";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing bracket in an array reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket_in_array_reference";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_annotation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a cast expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_cast"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a catch +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_catch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_constructor_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_enum_constant"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in an if statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_if"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a method invocation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_invocation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a parenthesized expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_parenthesized_expression"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a switch statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_switch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a synchronized statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_synchronized" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_synchronized"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the closing parenthesis in a while statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_while"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before colon in an assert statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_assert" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_assert"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before colon in a case statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_case"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before colon in a conditional expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_conditional"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before colon in a default statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_default"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before colon in a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before colon in a labeled statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_labeled_statement"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in an allocation expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_allocation_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_allocation_expression"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the parameters of a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_constructor_declaration_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_constructor_declaration_throws"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the arguments of enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_constant_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in enum declarations +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_declarations"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the arguments of an explicit constructor call +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the increments of a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_increments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_increments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the initializations of a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_inits" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_inits"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the parameters of a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_throws"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the arguments of a method invocation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_invocation_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in a multiple field declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_multiple_field_declarations"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in a multiple local declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_multiple_local_declarations"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in parameterized type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_parameterized_type_reference"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in the superinterfaces names in a type header +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_superinterfaces" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_superinterfaces"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in type arguments +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_type_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_type_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before comma in type parameters +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_type_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_type_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before ellipsis +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_ellipsis" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_ellipsis"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening angle bracket in parameterized type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening angle bracket in type arguments +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_type_arguments"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening angle bracket in type parameters +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_type_parameters"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in an annotation type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_annotation_type_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in an anonymous type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in a block +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_block"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_constructor_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in an enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_enum_constant"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in an enum declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_enum_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_method_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in a switch statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_switch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening brace in a type declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_type_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening bracket in an array allocation expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_allocation_expression";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening bracket in an array reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_reference";//$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening bracket in an array type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_type_reference"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in annotation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_annotation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_annotation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in annotation type member declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a catch +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_catch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_constructor_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_enum_constant"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in an if statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_if"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a method invocation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_invocation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a parenthesized expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a switch statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_switch"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a synchronized statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_synchronized" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_synchronized"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before the opening parenthesis in a while statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_while"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before parenthesized expression in return statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_parenthesized_expression_in_return" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * +// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_parenthesized_expression_in_return"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before a postfix operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_postfix_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before a prefix operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_prefix_operator"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before question mark in a conditional expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_conditional"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before question mark in a wildcard +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_question_in_wildcard" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_wildcard"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before semicolon +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_semicolon" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before semicolon in for statement +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon_in_for"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space before unary operator +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_before_unary_operator" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_unary_operator"; //$NON-NLS-1$ +// +// /** +// *
+// * FORMATTER / Option to insert a space between brackets in an array type reference +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_brackets_in_array_type_reference" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * 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" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#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$ +// /** +// *
+// * FORMATTER / Option to insert a space between empty brackets in an array allocation expression +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_brackets_in_array_allocation_expression"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space between empty parenthesis in an annotation type member declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space between empty parenthesis in a constructor declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_constructor_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space between empty parenthesis in enum constant +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_enum_constant"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space between empty parenthesis in a method declaration +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_declaration"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to insert a space between empty parenthesis in a method invocation +// * - option id: "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" +// * - possible values: { INSERT, DO_NOT_INSERT } +// * - default: DO_NOT_INSERT +// *+// * @see CCorePlugin#INSERT +// * @see CCorePlugin#DO_NOT_INSERT +// */ +// public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_invocation"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to keep else statement on the same line +// * - option id: "org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @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$ +// /** +// *
+// * FORMATTER / Option to keep empty array initializer one one line +// * - option id: "org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @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$ +// /** +// *
+// * FORMATTER / Option to keep guardian clause on one line +// * - option id: "org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public static final String FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.format_guardian_clause_on_one_line"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to keep simple if statement on the one line +// * - option id: "org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public static final String FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_imple_if_on_one_line"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to keep then statement on the same line +// * - option id: "org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public static final String FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_then_statement_on_same_line";//$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option to specify the length of the page. Beyond this length, the formatter will try to split the code + * - option id: "org.eclipse.cdt.core.formatter.lineSplit" + * - possible values: "<n>", where n is zero or a positive integer + * - default: "80" + *+ */ + public static final String FORMATTER_LINE_SPLIT = CCorePlugin.PLUGIN_ID + ".formatter.lineSplit"; //$NON-NLS-1$ +// +// /** +// *
+// * FORMATTER / Option to specify the number of empty lines to preserve +// * - option id: "org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve" +// * - possible values: "<n>", where n is zero or a positive integer +// * - default: "0" +// *+// */ +// public static final String FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE = CCorePlugin.PLUGIN_ID + ".formatter.number_of_empty_lines_to_preserve"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Option to specify whether or not empty statement should be on a new line +// * - option id: "org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line" +// * - possible values: { TRUE, FALSE } +// * - default: FALSE +// *+// * @see #TRUE +// * @see #FALSE +// */ +// public static final String FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE = CCorePlugin.PLUGIN_ID + ".formatter.put_empty_statement_on_new_line"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to specify the tabulation size + * - option id: "org.eclipse.cdt.core.formatter.tabulation.char" + * - possible values: { TAB, SPACE, MIXED } + * - default: TAB + *+ * More values may be added in the future. + * + * @see CCorePlugin#TAB + * @see CCorePlugin#SPACE + * @see #MIXED + */ + public static final String FORMATTER_TAB_CHAR = CCorePlugin.PLUGIN_ID + ".formatter.tabulation.char"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Option to specify the equivalent number of spaces that represents one tabulation + * - option id: "org.eclipse.cdt.core.formatter.tabulation.size" + * - possible values: "<n>", where n is zero or a positive integer + * - default: "4" + *+ */ + public static final String FORMATTER_TAB_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.tabulation.size"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / Option to use tabulations only for leading indentations + * - option id: "org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations" + * - possible values: { TRUE, FALSE } + * - default: FALSE + *+ * @see #TRUE + * @see #FALSE + */ + public static final String FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS = CCorePlugin.PLUGIN_ID + ".formatter.use_tabs_only_for_leading_indentations"; //$NON-NLS-1$ + + /** + *
+ * FORMATTER / The wrapping is done by indenting by one compare to the current indentation. + *+ */ + public static final int INDENT_BY_ONE= 2; + + /** + *
+ * FORMATTER / The wrapping is done by using the current indentation. + *+ */ + public static final int INDENT_DEFAULT= 0; + /** + *
+ * FORMATTER / The wrapping is done by indenting on column under the splitting location. + *+ */ + public static final int INDENT_ON_COLUMN = 1; + + /** + *
+ * FORMATTER / Possible value for the option FORMATTER_TAB_CHAR + *+ * @see CCorePlugin#TAB + * @see CCorePlugin#SPACE + * @see #FORMATTER_TAB_CHAR + */ + public static final String MIXED = "mixed"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Value to set a brace location at the start of the next line with +// * the right indentation. +// *+// * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION +// * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER +// * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK +// * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION +// * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION +// * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH +// * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION +// */ +// public static final String NEXT_LINE = "next_line"; //$NON-NLS-1$ +// /** +// *
+// * FORMATTER / Value to set a brace location at the start of the next line if a wrapping +// * occured. +// *+// * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION +// * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER +// * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK +// * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION +// * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION +// * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH +// * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION +// */ +// public static final String NEXT_LINE_ON_WRAP = "next_line_on_wrap"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Value to set a brace location at the start of the next line with + * an extra indentation. + *+ * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION + * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER + * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK + * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION + * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION + * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH + * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION + */ + public static final String NEXT_LINE_SHIFTED = "next_line_shifted"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / Value to set an option to true. + *+ */ + public static final String TRUE = "true"; //$NON-NLS-1$ + /** + *
+ * FORMATTER / The wrapping is done using as few lines as possible. + *+ */ + public static final int WRAP_COMPACT= 1; + /** + *
+ * FORMATTER / The wrapping is done putting the first element on a new + * line and then wrapping next elements using as few lines as possible. + *+ */ + public static final int WRAP_COMPACT_FIRST_BREAK= 2; + /** + *
+ * FORMATTER / The wrapping is done by putting each element on its own line + * except the first element. + *+ */ + public static final int WRAP_NEXT_PER_LINE= 5; + /** + *
+ * FORMATTER / The wrapping is done by putting each element on its own line. + * All elements are indented by one except the first element. + *+ */ + public static final int WRAP_NEXT_SHIFTED= 4; + + /** + *
+ * FORMATTER / Value to disable alignment. + *+ */ + public static final int WRAP_NO_SPLIT= 0; + /** + *
+ * FORMATTER / The wrapping is done by putting each element on its own line. + *+ */ + public static final int WRAP_ONE_PER_LINE= 3; + + /* + * Private constants. + */ + private static final IllegalArgumentException WRONG_ARGUMENT = new IllegalArgumentException(); + + /** + * Create a new alignment value according to the given values. This must be used to set up + * the alignment options. + * + * @param forceSplit the given force value + * @param wrapStyle the given wrapping style + * @param indentStyle the given indent style + * + * @return the new alignement value + */ + public static String createAlignmentValue(boolean forceSplit, int wrapStyle, int indentStyle) { + int alignmentValue = 0; + switch(wrapStyle) { + case WRAP_COMPACT : + alignmentValue |= Alignment.M_COMPACT_SPLIT; + break; + case WRAP_COMPACT_FIRST_BREAK : + alignmentValue |= Alignment.M_COMPACT_FIRST_BREAK_SPLIT; + break; + case WRAP_NEXT_PER_LINE : + alignmentValue |= Alignment.M_NEXT_PER_LINE_SPLIT; + break; + case WRAP_NEXT_SHIFTED : + alignmentValue |= Alignment.M_NEXT_SHIFTED_SPLIT; + break; + case WRAP_ONE_PER_LINE : + alignmentValue |= Alignment.M_ONE_PER_LINE_SPLIT; + break; + } + if (forceSplit) { + alignmentValue |= Alignment.M_FORCE; + } + switch(indentStyle) { + case INDENT_BY_ONE : + alignmentValue |= Alignment.M_INDENT_BY_ONE; + break; + case INDENT_ON_COLUMN : + alignmentValue |= Alignment.M_INDENT_ON_COLUMN; + } + return String.valueOf(alignmentValue); + } + + /** + * Returns the default Eclipse formatter settings + * + * @return the Eclipse default settings + */ + public static Map getEclipseDefaultSettings() { + return DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap(); + } + + /** + *
Return the force value of the given alignment value.
+ * The given alignment value should be created using the createAlignmentValue(boolean, int, int)
+ * API.
+ *
Return the indentation style of the given alignment value.
+ * The given alignment value should be created using the createAlignmentValue(boolean, int, int)
+ * API.
+ *
Return the wrapping style of the given alignment value.
+ * The given alignment value should be created using the createAlignmentValue(boolean, int, int)
+ * API.
+ *
Set the force value of the given alignment value and return the new value.
+ * The given alignment value should be created using the createAlignmentValue(boolean, int, int)
+ * API.
+ *
Set the indentation style of the given alignment value and return the new value.
+ * The given value should be created using the createAlignmentValue(boolean, int, int)
+ * API.
+ *
Set the wrapping style of the given alignment value and return the new value.
+ * The given value should be created using the createAlignmentValue(boolean, int, int)
+ * API.
+ *
#fragment1A | #fragment2A | #fragment3A | #very-long-fragment4A |
#fragment1B | #long-fragment2B | #fragment3B | #fragment4B |
#very-long-fragment1C | #fragment2C | #fragment3C | #fragment4C |
null
if the project is unknown
+ * and the workspace default should be used
+ * @return The tab width
+ */
+ public static int getTabWidth(ICProject project) {
+ /*
+ * If the tab-char is SPACE, FORMATTER_INDENTATION_SIZE is not used
+ * by the core formatter.
+ * We piggy back the visual tab length setting in that preference in
+ * that case.
+ */
+ String key;
+ if (CCorePlugin.SPACE.equals(getCoreOption(project, CodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ key= CodeFormatterConstants.FORMATTER_INDENTATION_SIZE;
+ else
+ key= CodeFormatterConstants.FORMATTER_TAB_SIZE;
+ return getCoreOption(project, key, 4);
+ }
+
+ /**
+ * Returns the current indent width.
+ *
+ * @param project the project where the source is used or null
+ * if the project is unknown and the workspace default should be used
+ * @return the indent width
+ */
+ public static int getIndentWidth(ICProject project) {
+ String key;
+ if (CodeFormatterConstants.MIXED.equals(getCoreOption(project, CodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ key= CodeFormatterConstants.FORMATTER_INDENTATION_SIZE;
+ else
+ key= CodeFormatterConstants.FORMATTER_TAB_SIZE;
+
+ return getCoreOption(project, key, 4);
+ }
+
+ /**
+ * Returns the possibly project
-specific core preference
+ * defined under key
.
+ *
+ * @param project the project to get the preference from, or
+ * null
to get the global preference
+ * @param key the key of the preference
+ * @return the value of the preference
+ */
+ private static String getCoreOption(ICProject project, String key) {
+ if (project == null)
+ return CCorePlugin.getOption(key);
+ return project.getOption(key, true);
+ }
+
+ /**
+ * Returns the possibly project
-specific core preference
+ * defined under key
, or def
if the value is
+ * not a integer.
+ *
+ * @param project the project to get the preference from, or
+ * null
to get the global preference
+ * @param key the key of the preference
+ * @param def the default value
+ * @return the value of the preference
+ */
+ private static int getCoreOption(ICProject project, String key, int def) {
+ try {
+ return Integer.parseInt(getCoreOption(project, key));
+ } catch (NumberFormatException e) {
+ return def;
+ }
+ }
+
/**
* Evaluates the edit on the given string.
* @throws IllegalArgumentException If the positions are not inside the string, a
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java
index d1a444e8b86..08b313c3a15 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/AddBlockCommentAction.java
@@ -15,7 +15,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ResourceBundle;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
import org.eclipse.jface.text.Assert;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPartitioningException;
@@ -25,6 +24,8 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* Action that encloses the editor's current selection with Java block comment terminators
* (/*
and */
).
@@ -109,7 +110,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
int partEndOffset= partition.getOffset() + partition.getLength();
int tokenLength= getCommentStart().length();
- if (partType == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partType == ICPartitions.C_MULTI_LINE_COMMENT) {
// already in a comment - remove ending mark
edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$
}
@@ -119,7 +120,7 @@ public class AddBlockCommentAction extends BlockCommentAction {
partType= partition.getType();
// start of next partition
- if (partType == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partType == ICPartitions.C_MULTI_LINE_COMMENT) {
// already in a comment - remove startToken
edits.add(factory.createEdit(partition.getOffset(), getCommentStart().length(), "")); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java
index e5ba8cbf413..331853af49e 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/RemoveBlockCommentAction.java
@@ -15,7 +15,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ResourceBundle;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPartitioningException;
import org.eclipse.jface.text.IDocumentExtension3;
@@ -23,6 +22,8 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* Action that removes the enclosing comment marks from a Java block comment.
*
@@ -59,7 +60,7 @@ public class RemoveBlockCommentAction extends BlockCommentAction {
while (partEndOffset < endOffset) {
- if (partition.getType() == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partition.getType() == ICPartitions.C_MULTI_LINE_COMMENT) {
edits.add(factory.createEdit(partOffset, tokenLength, "")); //$NON-NLS-1$
edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$
}
@@ -69,7 +70,7 @@ public class RemoveBlockCommentAction extends BlockCommentAction {
partEndOffset= partOffset + partition.getLength();
}
- if (partition.getType() == ICPartitions.C_MULTILINE_COMMENT) {
+ if (partition.getType() == ICPartitions.C_MULTI_LINE_COMMENT) {
edits.add(factory.createEdit(partOffset, tokenLength, "")); //$NON-NLS-1$
edits.add(factory.createEdit(partEndOffset - tokenLength, tokenLength, "")); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
index 03f3ac7b135..61a9edc6c28 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
@@ -129,6 +129,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IWorkingCopyManager;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.ui.actions.ShowInCViewAction;
+import org.eclipse.cdt.ui.text.ICPartitions;
import org.eclipse.cdt.ui.text.folding.ICFoldingStructureProvider;
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
@@ -149,7 +150,6 @@ import org.eclipse.cdt.internal.ui.text.CTextTools;
import org.eclipse.cdt.internal.ui.text.CWordIterator;
import org.eclipse.cdt.internal.ui.text.DocumentCharacterIterator;
import org.eclipse.cdt.internal.ui.text.HTMLTextPresenter;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
import org.eclipse.cdt.internal.ui.text.c.hover.SourceViewerInformationControl;
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
import org.eclipse.cdt.internal.ui.util.CUIHelp;
@@ -1481,52 +1481,50 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
}
public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- String text= command.text;
+ String text = command.text;
if (text == null)
return;
- int index= text.indexOf('\t');
+ int index = text.indexOf('\t');
if (index > -1) {
-
- StringBuffer buffer= new StringBuffer();
+ StringBuffer buffer = new StringBuffer();
fLineTracker.set(command.text);
- int lines= fLineTracker.getNumberOfLines();
+ int lines = fLineTracker.getNumberOfLines();
try {
+ for (int i = 0; i < lines; i++) {
+ int offset = fLineTracker.getLineOffset(i);
+ int endOffset = offset + fLineTracker.getLineLength(i);
+ String line = text.substring(offset, endOffset);
- for (int i= 0; i < lines; i++) {
-
- int offset= fLineTracker.getLineOffset(i);
- int endOffset= offset + fLineTracker.getLineLength(i);
- String line= text.substring(offset, endOffset);
-
- int position= 0;
- if (i == 0) {
- IRegion firstLine= document.getLineInformationOfOffset(command.offset);
- position= command.offset - firstLine.getOffset();
- }
-
- int length= line.length();
- for (int j= 0; j < length; j++) {
- char c= line.charAt(j);
- if (c == '\t') {
- position += insertTabString(buffer, position);
- } else {
- buffer.append(c);
- ++ position;
- }
- }
-
+ int position= 0;
+ if (i == 0) {
+ IRegion firstLine = document.getLineInformationOfOffset(command.offset);
+ position = command.offset - firstLine.getOffset();
}
- command.text= buffer.toString();
+ int length = line.length();
+ for (int j = 0; j < length; j++) {
+ char c = line.charAt(j);
+ if (c == '\t') {
+ int oldPosition = position;
+ position += insertTabString(buffer, position);
+ if (command.caretOffset > command.offset + oldPosition) {
+ command.caretOffset += position - oldPosition - 1;
+ }
+ } else {
+ buffer.append(c);
+ ++position;
+ }
+ }
+ }
+ command.text = buffer.toString();
} catch (BadLocationException x) {
}
}
}
-
}
/*
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java
index 53f02570c80..96252ea8385 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java
@@ -20,7 +20,7 @@ import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
-import org.eclipse.cdt.internal.ui.text.ICPartitions;
+import org.eclipse.cdt.ui.text.ICPartitions;
public class AsmSourceViewerConfiguration extends TextSourceViewerConfiguration {
@@ -83,8 +83,8 @@ public class AsmSourceViewerConfiguration extends TextSourceViewerConfiguration
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
dr= new DefaultDamagerRepairer(getMultilineCommentScanner());
- reconciler.setDamager(dr, ICPartitions.C_MULTILINE_COMMENT);
- reconciler.setRepairer(dr, ICPartitions.C_MULTILINE_COMMENT);
+ reconciler.setDamager(dr, ICPartitions.C_MULTI_LINE_COMMENT);
+ reconciler.setRepairer(dr, ICPartitions.C_MULTI_LINE_COMMENT);
dr= new DefaultDamagerRepairer(getSinglelineCommentScanner());
reconciler.setDamager(dr, ICPartitions.C_SINGLE_LINE_COMMENT);
@@ -108,7 +108,7 @@ public class AsmSourceViewerConfiguration extends TextSourceViewerConfiguration
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] {
IDocument.DEFAULT_CONTENT_TYPE,
- ICPartitions.C_MULTILINE_COMMENT,
+ ICPartitions.C_MULTI_LINE_COMMENT,
ICPartitions.C_SINGLE_LINE_COMMENT,
ICPartitions.C_STRING,
ICPartitions.C_CHARACTER };
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java
index 6efa1b17908..52900e3da5d 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java
@@ -9,33 +9,66 @@
* IBM Corporation - initial API and implementation
* QNX Software System
* Anton Leherbauer (Wind River Systems) - Fixed bug 48339
+ * Sergey Prigogin, Google
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
-
+import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.PreferenceConstants;
+import org.eclipse.cdt.ui.text.ICPartitions;
/**
* Auto indent strategy sensitive to brackets.
*/
public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
+ private static final String MULTILINE_COMMENT_CLOSE = "*/"; //$NON-NLS-1$
+// private static final GCCScannerExtensionConfiguration C_GNU_SCANNER_EXTENSION = new GCCScannerExtensionConfiguration();
- private final static String MULTILINE_COMMENT_CLOSE = "*/"; //$NON-NLS-1$
+ private static class CompilationUnitInfo {
+ char[] buffer;
+ int delta;
- public CAutoIndentStrategy() {
+ CompilationUnitInfo(char[] buffer, int delta) {
+ this.buffer = buffer;
+ this.delta = delta;
+ }
}
+ private boolean fCloseBrace;
+ private boolean fIsSmartMode;
+
+ private String fPartitioning;
+ private final ICProject fProject;
+
+ /**
+ * Creates a new C auto indent strategy for the given document partitioning.
+ *
+ * @param partitioning the document partitioning
+ * @param project the project to get formatting preferences from, or null to use default preferences
+ */
+ public CAutoIndentStrategy(String partitioning, ICProject project) {
+ fPartitioning = partitioning;
+ fProject = project;
+ }
+
// evaluate the line with the opening bracket that matches the closing bracket on the given line
protected int findMatchingOpenBracket(IDocument d, int line, int end, int closingBracketIncrease) throws BadLocationException {
- int start= d.getLineOffset(line);
- int brackcount= getBracketCount(d, start, end, false) - closingBracketIncrease;
+ int start = d.getLineOffset(line);
+ int brackcount = getBracketCount(d, start, end, false) - closingBracketIncrease;
// sum up the brackets counts of each line (closing brackets count negative,
@@ -45,8 +78,8 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
if (line < 0) {
return -1;
}
- start= d.getLineOffset(line);
- end= start + d.getLineLength(line) - 1;
+ start = d.getLineOffset(line);
+ end = start + d.getLineLength(line) - 1;
brackcount += getBracketCount(d, start, end, false);
}
return line;
@@ -54,36 +87,36 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
- int bracketcount= 0;
+ int bracketcount = 0;
while (start < end) {
- char curr= d.getChar(start);
+ char curr = d.getChar(start);
start++;
switch (curr) {
case '/' :
if (start < end) {
- char next= d.getChar(start);
+ char next = d.getChar(start);
if (next == '*') {
// a comment starts, advance to the comment end
- start= getCommentEnd(d, start + 1, end);
+ start = getCommentEnd(d, start + 1, end);
} else if (next == '/') {
// '//'-comment: nothing to do anymore on this line
- start= end;
+ start = end;
}
}
break;
case '*' :
if (start < end) {
- char next= d.getChar(start);
+ char next = d.getChar(start);
if (next == '/') {
// we have been in a comment: forget what we read before
- bracketcount= 0;
+ bracketcount = 0;
start++;
}
}
break;
case '{' :
bracketcount++;
- ignoreCloseBrackets= false;
+ ignoreCloseBrackets = false;
break;
case '}' :
if (!ignoreCloseBrackets) {
@@ -92,7 +125,7 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
break;
case '"' :
case '\'' :
- start= getStringEnd(d, start, end, curr);
+ start = getStringEnd(d, start, end, curr);
break;
default :
}
@@ -105,7 +138,7 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
while (pos < end) {
- char curr= d.getChar(pos);
+ char curr = d.getChar(pos);
pos++;
if (curr == '*') {
if (pos < end && d.getChar(pos) == '/') {
@@ -118,9 +151,9 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
protected String getIndentOfLine(IDocument d, int line) throws BadLocationException {
if (line > -1) {
- int start= d.getLineOffset(line);
- int end= start + d.getLineLength(line) - 1;
- int whiteend= findEndOfWhiteSpace(d, start, end);
+ int start = d.getLineOffset(line);
+ int end = start + d.getLineLength(line) - 1;
+ int whiteend = findEndOfWhiteSpace(d, start, end);
return d.get(start, whiteend - start);
}
return ""; //$NON-NLS-1$
@@ -128,7 +161,7 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
while (pos < end) {
- char curr= d.getChar(pos);
+ char curr = d.getChar(pos);
pos++;
if (curr == '\\') {
// ignore escaped characters
@@ -145,26 +178,26 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
return;
try {
- int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);
- int line= d.getLineOfOffset(p);
- int start= d.getLineOffset(line);
- int whiteend= findEndOfWhiteSpace(d, start, c.offset);
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+ int line = d.getLineOfOffset(p);
+ int start = d.getLineOffset(line);
+ int whiteend = findEndOfWhiteSpace(d, start, c.offset);
// shift only when line does not contain any text up to the closing bracket
if (whiteend == c.offset) {
// evaluate the line with the opening bracket that matches out closing bracket
- int indLine= findMatchingOpenBracket(d, line, c.offset, 1);
+ int indLine = findMatchingOpenBracket(d, line, c.offset, 1);
if (indLine != -1 && indLine != line) {
// take the indent of the found line
- StringBuffer replaceText= new StringBuffer(getIndentOfLine(d, indLine));
+ StringBuffer replaceText = new StringBuffer(getIndentOfLine(d, indLine));
// add the rest of the current line including the just added close bracket
replaceText.append(d.get(whiteend, c.offset - whiteend));
replaceText.append(c.text);
// modify document command
- c.length= c.offset - start;
- c.offset= start;
- c.text= replaceText.toString();
+ c.length = c.offset - start;
+ c.offset = start;
+ c.text = replaceText.toString();
}
}
} catch (BadLocationException excp) {
@@ -172,69 +205,453 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
}
- protected void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
- int docLength= d.getLength();
+ private void smartIndentAfterClosingBracket(IDocument d, DocumentCommand c) {
+ if (c.offset == -1 || d.getLength() == 0)
+ return;
+
+ try {
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+ int line = d.getLineOfOffset(p);
+ int start = d.getLineOffset(line);
+ int whiteend = findEndOfWhiteSpace(d, start, c.offset);
+
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+
+ // shift only when line does not contain any text up to the closing bracket
+ if (whiteend == c.offset) {
+ // evaluate the line with the opening bracket that matches out closing bracket
+ int reference = indenter.findReferencePosition(c.offset, false, true, false, false);
+ int indLine = d.getLineOfOffset(reference);
+ if (indLine != -1 && indLine != line) {
+ // take the indent of the found line
+ StringBuffer replaceText = new StringBuffer(getIndentOfLine(d, indLine));
+ // add the rest of the current line including the just added close bracket
+ replaceText.append(d.get(whiteend, c.offset - whiteend));
+ replaceText.append(c.text);
+ // modify document command
+ c.length += c.offset - start;
+ c.offset = start;
+ c.text = replaceText.toString();
+ }
+ }
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+ }
+
+ private void smartIndentAfterOpeningBracket(IDocument d, DocumentCommand c) {
+ if (c.offset < 1 || d.getLength() == 0)
+ return;
+
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+
+ try {
+ // current line
+ int line = d.getLineOfOffset(p);
+ int lineOffset = d.getLineOffset(line);
+
+ // make sure we don't have any leading comments etc.
+ if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
+ return;
+
+ // line of last javacode
+ int pos = scanner.findNonWhitespaceBackward(p, CHeuristicScanner.UNBOUND);
+ if (pos == -1)
+ return;
+ int lastLine = d.getLineOfOffset(pos);
+
+ // only shift if the last java line is further up and is a braceless block candidate
+ if (lastLine < line) {
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ StringBuffer indent = indenter.computeIndentation(p, true);
+ String toDelete = d.get(lineOffset, c.offset - lineOffset);
+ if (indent != null && !indent.toString().equals(toDelete)) {
+ c.text = indent.append(c.text).toString();
+ c.length += c.offset - lineOffset;
+ c.offset = lineOffset;
+ }
+ }
+
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+ }
+
+ private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ StringBuffer indent = indenter.computeIndentation(c.offset);
+ if (indent == null)
+ indent = new StringBuffer();
+
+ int docLength = d.getLength();
if (c.offset == -1 || docLength == 0)
return;
try {
- int p= (c.offset == docLength ? c.offset - 1 : c.offset);
- int line= d.getLineOfOffset(p);
+ int p = (c.offset == docLength ? c.offset - 1 : c.offset);
+ int line = d.getLineOfOffset(p);
+ StringBuffer buf = new StringBuffer(c.text + indent);
- StringBuffer buf= new StringBuffer(c.text);
- if (c.offset < docLength && d.getChar(c.offset) == '}') {
- int indLine= findMatchingOpenBracket(d, line, c.offset, 0);
- if (indLine == -1) {
- indLine= line;
+ IRegion reg = d.getLineInformation(line);
+ int lineEnd = reg.getOffset() + reg.getLength();
+
+ int contentStart = findEndOfWhiteSpace(d, c.offset, lineEnd);
+ c.length = Math.max(contentStart - c.offset, 0);
+
+ int start = reg.getOffset();
+
+ // insert closing brace on new line after an unclosed opening brace
+ if (getBracketCount(d, start, c.offset, true) > 0 && fCloseBrace && !isClosedBrace(d, c.offset, c.length)) {
+ c.caretOffset = c.offset + buf.length();
+ c.shiftsCaret = false;
+
+ // copy old content of line behind insertion point to new line
+ // unless we think we are inserting an anonymous type definition
+ if (c.offset == 0 || !(computeAnonymousPosition(d, c.offset - 1, fPartitioning, lineEnd) != -1)) {
+ if (lineEnd - contentStart > 0) {
+ c.length = lineEnd - c.offset;
+ buf.append(d.get(contentStart, lineEnd - contentStart).toCharArray());
+ }
}
- buf.append(getIndentOfLine(d, indLine));
- } else {
- int start= d.getLineOffset(line);
- int whiteend= findEndOfWhiteSpace(d, start, c.offset);
- buf.append(d.get(start, whiteend - start));
- if (getBracketCount(d, start, c.offset, true) > 0) {
- buf.append('\t');
+
+ buf.append(TextUtilities.getDefaultLineDelimiter(d));
+ StringBuffer reference = null;
+ int nonWS = findEndOfWhiteSpace(d, start, lineEnd);
+ if (nonWS < c.offset && d.getChar(nonWS) == '{')
+ reference = new StringBuffer(d.get(start, nonWS - start));
+ else
+ reference = indenter.getReferenceIndentation(c.offset);
+ if (reference != null)
+ buf.append(reference);
+ buf.append('}');
+ }
+ // insert extra line upon new line between two braces
+ else if (c.offset > start && contentStart < lineEnd && d.getChar(contentStart) == '}') {
+ int firstCharPos = scanner.findNonWhitespaceBackward(c.offset - 1, start);
+ if (firstCharPos != CHeuristicScanner.NOT_FOUND && d.getChar(firstCharPos) == '{') {
+ c.caretOffset = c.offset + buf.length();
+ c.shiftsCaret = false;
+
+ StringBuffer reference = null;
+ int nonWS = findEndOfWhiteSpace(d, start, lineEnd);
+ if (nonWS < c.offset && d.getChar(nonWS) == '{')
+ reference = new StringBuffer(d.get(start, nonWS - start));
+ else
+ reference = indenter.getReferenceIndentation(c.offset);
+
+ buf.append(TextUtilities.getDefaultLineDelimiter(d));
+
+ if (reference != null)
+ buf.append(reference);
}
}
- c.text= buf.toString();
+ c.text = buf.toString();
-
- } catch (BadLocationException excp) {
- CUIPlugin.getDefault().log(excp);
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
}
}
/**
- * Returns whether the text ends with one of the given search strings.
+ * Computes an insert position for an opening brace if offset
maps to a position in
+ * document
with a expression in parenthesis that will take a block after the closing parenthesis.
+ *
+ * @param document the document being modified
+ * @param offset the offset of the caret position, relative to the line start.
+ * @param partitioning the document partitioning
+ * @param max the max position
+ * @return an insert position relative to the line start if line
contains a parenthesized expression that can be followed by a block, -1 otherwise
*/
- private boolean endsWithDelimiter(IDocument d, String txt) {
- String[] delimiters= d.getLegalLineDelimiters();
-
- for (int i= 0; i < delimiters.length; i++) {
- if (txt.endsWith(delimiters[i]))
- return true;
+ private static int computeAnonymousPosition(IDocument document, int offset, String partitioning, int max) {
+ // find the opening parenthesis for every closing parenthesis on the current line after offset
+ // return the position behind the closing parenthesis if it looks like a method declaration
+ // or an expression for an if, while, for, catch statement
+
+ CHeuristicScanner scanner = new CHeuristicScanner(document);
+ int pos = offset;
+ int length = max;
+ int scanTo = scanner.scanForward(pos, length, '}');
+ if (scanTo == -1)
+ scanTo = length;
+
+ int closingParen = findClosingParenToLeft(scanner, pos) - 1;
+
+ while (true) {
+ int startScan = closingParen + 1;
+ closingParen = scanner.scanForward(startScan, scanTo, ')');
+ if (closingParen == -1)
+ break;
+
+ int openingParen = scanner.findOpeningPeer(closingParen - 1, '(', ')');
+
+ // no way an expression at the beginning of the document can mean anything
+ if (openingParen < 1)
+ break;
+
+ // only select insert positions for parenthesis currently embracing the caret
+ if (openingParen > pos)
+ continue;
}
+
+ return -1;
+ }
+
+ /**
+ * Finds a closing parenthesis to the left of position
in document, where that parenthesis is only
+ * separated by whitespace from position
. If no such parenthesis can be found, position
is returned.
+ *
+ * @param scanner the java heuristic scanner set up on the document
+ * @param position the first character position in document
to be considered
+ * @return the position of a closing parenthesis left to position
separated only by whitespace, or position
if no parenthesis can be found
+ */
+ private static int findClosingParenToLeft(CHeuristicScanner scanner, int position) {
+ if (position < 1)
+ return position;
+
+ if (scanner.previousToken(position - 1, CHeuristicScanner.UNBOUND) == Symbols.TokenRPAREN)
+ return scanner.getPosition() + 1;
+ return position;
+ }
+
+ private boolean isClosedBrace(IDocument document, int offset, int length) {
+ CompilationUnitInfo info = getCompilationUnitForMethod(document, offset, fPartitioning);
+ if (info == null)
+ return false;
+
+ return getBlockBalance(document, offset, fPartitioning) <= 0;
+ //TODO: Use smarter algorithm based on
+// CodeReader reader = new CodeReader(info.buffer);
+// ICodeReaderFactory fileCreator = CDOM.getInstance().getCodeReaderFactory(CDOM.PARSE_WORKING_COPY_WHENEVER_POSSIBLE);
+//
+// IScanner domScanner = new DOMScanner(reader, new ScannerInfo(), ParserMode.COMPLETE_PARSE,
+// ParserLanguage.C, ParserFactory.createDefaultLogService(),
+// C_GNU_SCANNER_EXTENSION, fileCreator);
+//
+// ISourceCodeParser parser = new GNUCPPSourceParser(
+// domScanner,
+// ParserMode.COMPLETE_PARSE,
+// ParserUtil.getParserLogService(),
+// new GPPParserExtensionConfiguration());
+//
+// IASTTranslationUnit translationUnit = parser.parse();
+// final int relativeOffset = offset - info.delta;
+// IASTNode node = translationUnit.selectNodeForLocation(reader.getPath(), relativeOffset, length);
+//
+// if (node == null)
+// return false;
+//
+// if (node instanceof IASTCompoundStatement) {
+// return getBlockBalance(document, offset, fPartitioning) <= 0;
+// } else if (node instanceof IASTIfStatement) {
+// IASTIfStatement ifStatement = (IASTIfStatement) node;
+// IASTExpression expression = ifStatement.getConditionExpression();
+// IRegion expressionRegion = createRegion(expression, info.delta);
+// IASTStatement thenStatement = ifStatement.getThenClause();
+// IRegion thenRegion = createRegion(thenStatement, info.delta);
+//
+// // Between expression and then statement
+// if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= thenRegion.getOffset())
+// return thenStatement != null;
+//
+// IASTStatement elseStatement = ifStatement.getElseClause();
+// IRegion elseRegion = createRegion(elseStatement, info.delta);
+//
+// if (elseStatement != null) {
+// int sourceOffset = thenRegion.getOffset() + thenRegion.getLength();
+// int sourceLength = elseRegion.getOffset() - sourceOffset;
+// CHeuristicScanner scanner = new CHeuristicScanner(new SimpleDocument(info.buffer));
+// int pos = sourceOffset;
+// int id;
+// while ((id = scanner.nextToken(pos, sourceOffset + sourceLength - pos)) != CHeuristicScanner.TokenEOF) {
+// if (id == CHeuristicScanner.TokenELSE) {
+// pos = scanner.getPosition();
+// // Between 'else' token and else statement.
+// return pos <= offset && offset + length < elseRegion.getOffset();
+// }
+// }
+//
+// return true;
+// }
+// } else if (node instanceof IASTForStatement) {
+// IASTExpression expression = ((IASTForStatement) node).getConditionExpression();
+// IRegion expressionRegion = createRegion(expression, info.delta);
+// IASTStatement body = ((IASTForStatement) node).getBody();
+// IRegion bodyRegion = createRegion(body, info.delta);
+//
+// // Between expression and body statement
+// if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
+// return body != null;
+// }
+// } else if (node instanceof IASTWhileStatement) {
+// IASTExpression expression = ((IASTWhileStatement) node).getCondition();
+// IRegion expressionRegion = createRegion(expression, info.delta);
+// IASTStatement body = ((IASTWhileStatement) node).getBody();
+// IRegion bodyRegion = createRegion(body, info.delta);
+//
+// // Between expression and body statement
+// if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
+// return body != null;
+// }
+// } else if (node instanceof IASTDoStatement) {
+// IASTDoStatement doStatement = (IASTDoStatement) node;
+// IRegion doRegion = createRegion(doStatement, info.delta);
+// IASTStatement body = doStatement.getBody();
+// IRegion bodyRegion = createRegion(body, info.delta);
+//
+// // Between 'do' and body statement.
+// if (doRegion.getOffset() + doRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
+// return body != null;
+// }
+// }
+//
+// return true;
+ }
+
+ private boolean isLineDelimiter(IDocument document, String text) {
+ String[] delimiters = document.getLegalLineDelimiters();
+ if (delimiters != null)
+ return TextUtilities.equals(delimiters, text) > -1;
return false;
- }
+ }
+
+ private void smartIndentOnKeypress(IDocument document, DocumentCommand command) {
+ switch (command.text.charAt(0)) {
+ case '}':
+ smartIndentAfterClosingBracket(document, command);
+ break;
+ case '{':
+ smartIndentAfterOpeningBracket(document, command);
+ break;
+ case 'e':
+ smartIndentUponE(document, command);
+ break;
+ }
+ }
+
+ private void smartIndentUponE(IDocument d, DocumentCommand c) {
+ if (c.offset < 4 || d.getLength() == 0)
+ return;
+
+ try {
+ String content = d.get(c.offset - 3, 3);
+ if (content.equals("els")) { //$NON-NLS-1$
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ int p = c.offset - 3;
+
+ // current line
+ int line = d.getLineOfOffset(p);
+ int lineOffset = d.getLineOffset(line);
+
+ // make sure we don't have any leading comments etc.
+ if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
+ return;
+
+ // line of last javacode
+ int pos = scanner.findNonWhitespaceBackward(p - 1, CHeuristicScanner.UNBOUND);
+ if (pos == -1)
+ return;
+ int lastLine = d.getLineOfOffset(pos);
+
+ // only shift if the last java line is further up and is a braceless block candidate
+ if (lastLine < line) {
+
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ int ref = indenter.findReferencePosition(p, true, false, false, false);
+ if (ref == CHeuristicScanner.NOT_FOUND)
+ return;
+ int refLine = d.getLineOfOffset(ref);
+ String indent = getIndentOfLine(d, refLine);
+
+ if (indent != null) {
+ c.text = indent.toString() + "else"; //$NON-NLS-1$
+ c.length += c.offset - lineOffset;
+ c.offset = lineOffset;
+ }
+ }
+
+ return;
+ }
+
+ if (content.equals("cas")) { //$NON-NLS-1$
+ CHeuristicScanner scanner = new CHeuristicScanner(d);
+ int p = c.offset - 3;
+
+ // current line
+ int line = d.getLineOfOffset(p);
+ int lineOffset = d.getLineOffset(line);
+
+ // make sure we don't have any leading comments etc.
+ if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
+ return;
+
+ // line of last javacode
+ int pos = scanner.findNonWhitespaceBackward(p - 1, CHeuristicScanner.UNBOUND);
+ if (pos == -1)
+ return;
+ int lastLine = d.getLineOfOffset(pos);
+
+ // only shift if the last java line is further up and is a braceless block candidate
+ if (lastLine < line) {
+
+ CIndenter indenter = new CIndenter(d, scanner, fProject);
+ int ref = indenter.findReferencePosition(p, false, false, false, true);
+ if (ref == CHeuristicScanner.NOT_FOUND)
+ return;
+ int refLine = d.getLineOfOffset(ref);
+ int nextToken = scanner.nextToken(ref, CHeuristicScanner.UNBOUND);
+ String indent;
+ if (nextToken == Symbols.TokenCASE || nextToken == Symbols.TokenDEFAULT)
+ indent = getIndentOfLine(d, refLine);
+ else // at the brace of the switch
+ indent = indenter.computeIndentation(p).toString();
+
+ if (indent != null) {
+ c.text = indent.toString() + "case"; //$NON-NLS-1$
+ c.length += c.offset - lineOffset;
+ c.offset = lineOffset;
+ }
+ }
+
+ return;
+ }
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+ }
/*
- * @see org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy#customizeDocumentCommand(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand)
+ * @see org.eclipse.jface.text.IAutoEditStrategy#customizeDocumentCommand(IDocument, DocumentCommand)
*/
public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
- if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) {
+ if (!c.doit)
+ return;
+
+ clearCachedValues();
+ if (!fIsSmartMode) {
+ super.customizeDocumentCommand(d, c);
+ return;
+ }
+
+ if (c.length == 0 && c.text != null && isLineDelimiter(d, c.text)) {
if (isAppendToOpenMultilineComment(d, c)) {
// special case: multi-line comment at end of document (bug 48339)
CCommentAutoIndentStrategy.commentIndentAfterNewLine(d, c);
} else {
smartIndentAfterNewLine(d, c);
}
- } else if ("}".equals(c.text)) { //$NON-NLS-1$
- smartInsertAfterBracket(d, c);
- }
- else if ("/".equals(c.text) && isAppendToOpenMultilineComment(d, c)) { //$NON-NLS-1$
+ } else if ("/".equals(c.text) && isAppendToOpenMultilineComment(d, c)) { //$NON-NLS-1$
// special case: multi-line comment at end of document (bug 48339)
CCommentAutoIndentStrategy.commentIndentForCommentEnd(d, c);
+ } else if (c.text.length() == 1) {
+ smartIndentOnKeypress(d, c);
+// TODO Support smart paste.
+// } else if (c.text.length() > 1 && getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SMART_PASTE)) {
+// smartPaste(d, c); // no smart backspace for paste
}
}
@@ -244,12 +661,11 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
* @param c the document command
* @return true, if the command appends to an open multi-line comment.
*/
- static boolean isAppendToOpenMultilineComment(IDocument d, DocumentCommand c) {
+ private boolean isAppendToOpenMultilineComment(IDocument d, DocumentCommand c) {
if (d.getLength() >= 2 && c.offset == d.getLength()) {
try {
- String partitioning = CUIPlugin.getDefault().getTextTools().getDocumentPartitioning();
- String contentType = org.eclipse.jface.text.TextUtilities.getContentType(d, partitioning, c.offset - 1, false);
- if (ICPartitions.C_MULTILINE_COMMENT.equals(contentType)) {
+ String contentType = org.eclipse.jface.text.TextUtilities.getContentType(d, fPartitioning, c.offset - 1, false);
+ if (ICPartitions.C_MULTI_LINE_COMMENT.equals(contentType)) {
return !d.get(c.offset - 2, 2).equals(MULTILINE_COMMENT_CLOSE);
}
} catch (BadLocationException exc) {
@@ -259,4 +675,91 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
return false;
}
+ private static IPreferenceStore getPreferenceStore() {
+ return CUIPlugin.getDefault().getCombinedPreferenceStore();
+ }
+
+ private void clearCachedValues() {
+ IPreferenceStore preferenceStore = getPreferenceStore();
+ fCloseBrace = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
+ fIsSmartMode = computeSmartMode();
+ }
+
+ private boolean computeSmartMode() {
+ IWorkbenchPage page = CUIPlugin.getActivePage();
+ if (page != null) {
+ IEditorPart part = page.getActiveEditor();
+ if (part instanceof ITextEditorExtension3) {
+ ITextEditorExtension3 extension = (ITextEditorExtension3) part;
+ return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
+ }
+ if (part == null) {
+ // TODO: Remove this if statement once CAutoIndentTest is fixed so that getActiveEditor does not return null.
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static CompilationUnitInfo getCompilationUnitForMethod(IDocument document, int offset, String partitioning) {
+ try {
+ CHeuristicScanner scanner = new CHeuristicScanner(document);
+
+ IRegion sourceRange = scanner.findSurroundingBlock(offset);
+ if (sourceRange == null)
+ return null;
+ String source = document.get(sourceRange.getOffset(), sourceRange.getLength());
+
+ StringBuffer contents = new StringBuffer();
+ contents.append("class ____C{void ____m()"); //$NON-NLS-1$
+ final int methodOffset = contents.length();
+ contents.append(source);
+ contents.append("};"); //$NON-NLS-1$
+
+ char[] buffer = contents.toString().toCharArray();
+ return new CompilationUnitInfo(buffer, sourceRange.getOffset() - methodOffset);
+ } catch (BadLocationException e) {
+ CUIPlugin.getDefault().log(e);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the block balance, i.e. zero if the blocks are balanced at
+ * offset
, a negative number if there are more closing than opening
+ * braces, and a positive number if there are more opening than closing braces.
+ *
+ * @param document
+ * @param offset
+ * @param partitioning
+ * @return the block balance
+ */
+ private static int getBlockBalance(IDocument document, int offset, String partitioning) {
+ if (offset < 1)
+ return -1;
+ if (offset >= document.getLength())
+ return 1;
+
+ int begin = offset;
+ int end = offset - 1;
+
+ CHeuristicScanner scanner = new CHeuristicScanner(document);
+
+ while (true) {
+ begin = scanner.findOpeningPeer(begin - 1, '{', '}');
+ end = scanner.findClosingPeer(end + 1, '{', '}');
+ if (begin == -1 && end == -1)
+ return 0;
+ if (begin == -1)
+ return -1;
+ if (end == -1)
+ return 1;
+ }
+ }
+
+// private static IRegion createRegion(IASTNode node, int delta) {
+// IASTNodeLocation nodeLocation = node.getNodeLocations()[0];
+// return node == null ? null : new Region(nodeLocation.getNodeOffset() + delta, nodeLocation.getNodeLength());
+// }
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java
new file mode 100644
index 00000000000..259ca885476
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java
@@ -0,0 +1,867 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+import java.util.Arrays;
+
+import org.eclipse.cdt.ui.text.ICPartitions;
+
+import org.eclipse.jface.text.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.TypedRegion;
+
+/**
+ * Utility methods for heuristic based C manipulations in an incomplete C source file.
+ *
+ * An instance holds some internal position in the document and is therefore not threadsafe.
+ */ +public final class CHeuristicScanner implements Symbols { + /** + * Returned by all methods when the requested position could not be found, or if a + * {@link BadLocationException} was thrown while scanning. + */ + public static final int NOT_FOUND= -1; + + /** + * Special bound parameter that means either -1 (backward scanning) or + *fDocument.getLength()
(forward scanning).
+ */
+ public static final int UNBOUND= -2;
+
+
+ /* character constants */
+ private static final char LBRACE= '{';
+ private static final char RBRACE= '}';
+ private static final char LPAREN= '(';
+ private static final char RPAREN= ')';
+ private static final char SEMICOLON= ';';
+ private static final char COLON= ':';
+ private static final char COMMA= ',';
+ private static final char LBRACKET= '[';
+ private static final char RBRACKET= ']';
+ private static final char QUESTIONMARK= '?';
+ private static final char EQUAL= '=';
+ private static final char LANGLE= '<';
+ private static final char RANGLE= '>';
+
+ /**
+ * Specifies the stop condition, upon which the scanXXX
methods will decide whether
+ * to keep scanning or not. This interface may implemented by clients.
+ */
+ private static abstract class StopCondition {
+ /**
+ * Instructs the scanner to return the current position.
+ *
+ * @param ch the char at the current position
+ * @param position the current position
+ * @param forward the iteration direction
+ * @return true
if the stop condition is met.
+ */
+ public abstract boolean stop(char ch, int position, boolean forward);
+
+ /**
+ * Asks the condition to return the next position to query. The default
+ * is to return the next/previous position.
+ *
+ * @return the next position to scan
+ */
+ public int nextPosition(int position, boolean forward) {
+ return forward ? position + 1 : position - 1;
+ }
+ }
+
+ /**
+ * Stops upon a non-whitespace (as defined by {@link Character#isWhitespace(char)}) character.
+ */
+ private static class NonWhitespace extends StopCondition {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return !Character.isWhitespace(ch);
+ }
+ }
+
+ /**
+ * Stops upon a non-whitespace character in the default partition.
+ *
+ * @see NonWhitespace
+ */
+ private final class NonWhitespaceDefaultPartition extends NonWhitespace {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return super.stop(ch, position, true) && isDefaultPartition(position);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
+ */
+ public int nextPosition(int position, boolean forward) {
+ ITypedRegion partition= getPartition(position);
+ if (fPartition.equals(partition.getType()))
+ return super.nextPosition(position, forward);
+
+ if (forward) {
+ int end= partition.getOffset() + partition.getLength();
+ if (position < end)
+ return end;
+ } else {
+ int offset= partition.getOffset();
+ if (position > offset)
+ return offset - 1;
+ }
+ return super.nextPosition(position, forward);
+ }
+ }
+
+ /**
+ * Stops upon a non-java identifier (as defined by {@link Character#isJavaIdentifierPart(char)}) character.
+ */
+ private static class NonJavaIdentifierPart extends StopCondition {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return !Character.isJavaIdentifierPart(ch);
+ }
+ }
+
+ /**
+ * Stops upon a non-java identifier character in the default partition.
+ *
+ * @see NonJavaIdentifierPart
+ */
+ private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return super.stop(ch, position, true) || !isDefaultPartition(position);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
+ */
+ public int nextPosition(int position, boolean forward) {
+ ITypedRegion partition= getPartition(position);
+ if (fPartition.equals(partition.getType()))
+ return super.nextPosition(position, forward);
+
+ if (forward) {
+ int end= partition.getOffset() + partition.getLength();
+ if (position < end)
+ return end;
+ } else {
+ int offset= partition.getOffset();
+ if (position > offset)
+ return offset - 1;
+ }
+ return super.nextPosition(position, forward);
+ }
+ }
+
+ /**
+ * Stops upon a character in the default partition that matches the given character list.
+ */
+ private final class CharacterMatch extends StopCondition {
+ private final char[] fChars;
+
+ /**
+ * Creates a new instance.
+ * @param ch the single character to match
+ */
+ public CharacterMatch(char ch) {
+ this(new char[] {ch});
+ }
+
+ /**
+ * Creates a new instance.
+ * @param chars the chars to match.
+ */
+ public CharacterMatch(char[] chars) {
+ Assert.isNotNull(chars);
+ Assert.isTrue(chars.length > 0);
+ fChars= chars;
+ Arrays.sort(chars);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char, int)
+ */
+ public boolean stop(char ch, int position, boolean forward) {
+ return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
+ */
+ public int nextPosition(int position, boolean forward) {
+ ITypedRegion partition= getPartition(position);
+ if (fPartition.equals(partition.getType()))
+ return super.nextPosition(position, forward);
+
+ if (forward) {
+ int end= partition.getOffset() + partition.getLength();
+ if (position < end)
+ return end;
+ } else {
+ int offset= partition.getOffset();
+ if (position > offset)
+ return offset - 1;
+ }
+ return super.nextPosition(position, forward);
+ }
+ }
+
+ /** The document being scanned. */
+ private final IDocument fDocument;
+ /** The partitioning being used for scanning. */
+ private final String fPartitioning;
+ /** The partition to scan in. */
+ private final String fPartition;
+
+ /* internal scan state */
+
+ /** the most recently read character. */
+ private char fChar;
+ /** the most recently read position. */
+ private int fPos;
+ /**
+ * The most recently used partition.
+ */
+ private ITypedRegion fCachedPartition= new TypedRegion(-1, 0, "__no_partition_at_all"); //$NON-NLS-1$
+
+ /* preset stop conditions */
+ private final StopCondition fNonWSDefaultPart= new NonWhitespaceDefaultPartition();
+ private final static StopCondition fNonWS= new NonWhitespace();
+ private final StopCondition fNonIdent= new NonJavaIdentifierPartDefaultPartition();
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document to scan
+ * @param partitioning the partitioning to use for scanning
+ * @param partition the partition to scan in
+ */
+ public CHeuristicScanner(IDocument document, String partitioning, String partition) {
+ Assert.isLegal(document != null);
+ Assert.isLegal(partitioning != null);
+ Assert.isLegal(partition != null);
+ fDocument= document;
+ fPartitioning= partitioning;
+ fPartition= partition;
+ }
+
+ /**
+ * Calls this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)
.
+ *
+ * @param document the document to scan.
+ */
+ public CHeuristicScanner(IDocument document) {
+ this(document, ICPartitions.C_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE);
+ }
+
+ /**
+ * Returns the most recent internal scan position.
+ *
+ * @return the most recent internal scan position.
+ */
+ public int getPosition() {
+ return fPos;
+ }
+
+ /**
+ * Returns the next token in forward direction, starting at start
, and not extending
+ * further than bound
. The return value is one of the constants defined in {@link Symbols}.
+ * After a call, {@link #getPosition()} will return the position just after the scanned token
+ * (i.e. the next position that will be scanned).
+ *
+ * @param start the first character position in the document to consider
+ * @param bound the first position not to consider any more
+ * @return a constant from {@link Symbols} describing the next token
+ */
+ public int nextToken(int start, int bound) {
+ int pos= scanForward(start, bound, fNonWSDefaultPart);
+ if (pos == NOT_FOUND)
+ return TokenEOF;
+
+ fPos++;
+
+ switch (fChar) {
+ case LBRACE:
+ return TokenLBRACE;
+ case RBRACE:
+ return TokenRBRACE;
+ case LBRACKET:
+ return TokenLBRACKET;
+ case RBRACKET:
+ return TokenRBRACKET;
+ case LPAREN:
+ return TokenLPAREN;
+ case RPAREN:
+ return TokenRPAREN;
+ case SEMICOLON:
+ return TokenSEMICOLON;
+ case COMMA:
+ return TokenCOMMA;
+ case QUESTIONMARK:
+ return TokenQUESTIONMARK;
+ case EQUAL:
+ return TokenEQUAL;
+ case LANGLE:
+ return TokenLESSTHAN;
+ case RANGLE:
+ return TokenGREATERTHAN;
+ }
+
+ // else
+ if (Character.isJavaIdentifierPart(fChar)) {
+ // assume an identifier or keyword
+ int from= pos, to;
+ pos= scanForward(pos + 1, bound, fNonIdent);
+ if (pos == NOT_FOUND)
+ to= bound == UNBOUND ? fDocument.getLength() : bound;
+ else
+ to= pos;
+
+ String identOrKeyword;
+ try {
+ identOrKeyword= fDocument.get(from, to - from);
+ } catch (BadLocationException e) {
+ return TokenEOF;
+ }
+
+ return getToken(identOrKeyword);
+
+
+ } else {
+ // operators, number literals etc
+ return TokenOTHER;
+ }
+ }
+
+ /**
+ * Returns the next token in backward direction, starting at start
, and not extending
+ * further than bound
. The return value is one of the constants defined in {@link Symbols}.
+ * After a call, {@link #getPosition()} will return the position just before the scanned token
+ * starts (i.e. the next position that will be scanned).
+ *
+ * @param start the first character position in the document to consider
+ * @param bound the first position not to consider any more
+ * @return a constant from {@link Symbols} describing the previous token
+ */
+ public int previousToken(int start, int bound) {
+ int pos= scanBackward(start, bound, fNonWSDefaultPart);
+ if (pos == NOT_FOUND)
+ return TokenEOF;
+
+ fPos--;
+
+ switch (fChar) {
+ case LBRACE:
+ return TokenLBRACE;
+ case RBRACE:
+ return TokenRBRACE;
+ case LBRACKET:
+ return TokenLBRACKET;
+ case RBRACKET:
+ return TokenRBRACKET;
+ case LPAREN:
+ return TokenLPAREN;
+ case RPAREN:
+ return TokenRPAREN;
+ case SEMICOLON:
+ return TokenSEMICOLON;
+ case COLON:
+ return TokenCOLON;
+ case COMMA:
+ return TokenCOMMA;
+ case QUESTIONMARK:
+ return TokenQUESTIONMARK;
+ case EQUAL:
+ return TokenEQUAL;
+ case LANGLE:
+ return TokenLESSTHAN;
+ case RANGLE:
+ return TokenGREATERTHAN;
+ }
+
+ // else
+ if (Character.isJavaIdentifierPart(fChar)) {
+ // assume an ident or keyword
+ int from, to= pos + 1;
+ pos= scanBackward(pos - 1, bound, fNonIdent);
+ if (pos == NOT_FOUND)
+ from= bound == UNBOUND ? 0 : bound + 1;
+ else
+ from= pos + 1;
+
+ String identOrKeyword;
+ try {
+ identOrKeyword= fDocument.get(from, to - from);
+ } catch (BadLocationException e) {
+ return TokenEOF;
+ }
+
+ return getToken(identOrKeyword);
+
+
+ } else {
+ // operators, number literals etc
+ return TokenOTHER;
+ }
+
+ }
+
+ /**
+ * Returns one of the keyword constants or TokenIDENT
for a scanned identifier.
+ *
+ * @param s a scanned identifier
+ * @return one of the constants defined in {@link Symbols}
+ */
+ private int getToken(String s) {
+ Assert.isNotNull(s);
+
+ switch (s.length()) {
+ case 2:
+ if ("if".equals(s)) //$NON-NLS-1$
+ return TokenIF;
+ if ("do".equals(s)) //$NON-NLS-1$
+ return TokenDO;
+ break;
+ case 3:
+ if ("for".equals(s)) //$NON-NLS-1$
+ return TokenFOR;
+ if ("try".equals(s)) //$NON-NLS-1$
+ return TokenTRY;
+ if ("new".equals(s)) //$NON-NLS-1$
+ return TokenNEW;
+ break;
+ case 4:
+ if ("case".equals(s)) //$NON-NLS-1$
+ return TokenCASE;
+ if ("else".equals(s)) //$NON-NLS-1$
+ return TokenELSE;
+ if ("enum".equals(s)) //$NON-NLS-1$
+ return TokenENUM;
+ if ("goto".equals(s)) //$NON-NLS-1$
+ return TokenGOTO;
+ break;
+ case 5:
+ if ("break".equals(s)) //$NON-NLS-1$
+ return TokenBREAK;
+ if ("catch".equals(s)) //$NON-NLS-1$
+ return TokenCATCH;
+ if ("class".equals(s)) //$NON-NLS-1$
+ return TokenCLASS;
+ if ("while".equals(s)) //$NON-NLS-1$
+ return TokenWHILE;
+ break;
+ case 6:
+ if ("return".equals(s)) //$NON-NLS-1$
+ return TokenRETURN;
+ if ("static".equals(s)) //$NON-NLS-1$
+ return TokenSTATIC;
+ if ("switch".equals(s)) //$NON-NLS-1$
+ return TokenSWITCH;
+ break;
+ case 7:
+ if ("default".equals(s)) //$NON-NLS-1$
+ return TokenDEFAULT;
+ break;
+ }
+ return TokenIDENT;
+ }
+
+ /**
+ * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers
+ * are skipped. All peers accounted for must reside in the default partition.
+ *
+ * Note that start
must not point to the opening peer, but to the first
+ * character being searched.
NOT_FOUND
+ */
+ public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
+ Assert.isLegal(start >= 0);
+
+ try {
+ int depth= 1;
+ start -= 1;
+ while (true) {
+ start= scanForward(start + 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
+ if (start == NOT_FOUND)
+ return NOT_FOUND;
+
+ if (fDocument.getChar(start) == openingPeer)
+ depth++;
+ else
+ depth--;
+
+ if (depth == 0)
+ return start;
+ }
+
+ } catch (BadLocationException e) {
+ return NOT_FOUND;
+ }
+ }
+
+ /**
+ * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers
+ * are skipped. All peers accounted for must reside in the default partition.
+ *
+ * Note that start
must not point to the closing peer, but to the first
+ * character being searched.
NOT_FOUND
+ */
+ public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
+ Assert.isLegal(start < fDocument.getLength());
+
+ try {
+ int depth= 1;
+ start += 1;
+ while (true) {
+ start= scanBackward(start - 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
+ if (start == NOT_FOUND)
+ return NOT_FOUND;
+
+ if (fDocument.getChar(start) == closingPeer)
+ depth++;
+ else
+ depth--;
+
+ if (depth == 0)
+ return start;
+ }
+
+ } catch (BadLocationException e) {
+ return NOT_FOUND;
+ }
+ }
+
+ /**
+ * Computes the surrounding block around offset
. The search is started at the
+ * beginning of offset
, i.e. an opening brace at offset
will not be
+ * part of the surrounding block, but a closing brace will.
+ *
+ * @param offset the offset for which the surrounding block is computed
+ * @return a region describing the surrounding block, or null
if none can be found
+ */
+ public IRegion findSurroundingBlock(int offset) {
+ if (offset < 1 || offset >= fDocument.getLength())
+ return null;
+
+ int begin= findOpeningPeer(offset - 1, LBRACE, RBRACE);
+ int end= findClosingPeer(offset, LBRACE, RBRACE);
+ if (begin == NOT_FOUND || end == NOT_FOUND)
+ return null;
+ return new Region(begin, end + 1 - begin);
+ }
+
+ /**
+ * Finds the smallest position in fDocument
such that the position is >= position
+ * and < bound
and Character.isWhitespace(fDocument.getChar(pos))
evaluates to false
+ * and the position is in the default partition.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
> position
, or UNBOUND
+ * @return the smallest position of a non-whitespace character in [position
, bound
) that resides in a C partition, or NOT_FOUND
if none can be found
+ */
+ public int findNonWhitespaceForward(int position, int bound) {
+ return scanForward(position, bound, fNonWSDefaultPart);
+ }
+
+ /**
+ * Finds the smallest position in fDocument
such that the position is >= position
+ * and < bound
and Character.isWhitespace(fDocument.getChar(pos))
evaluates to false
.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
> position
, or UNBOUND
+ * @return the smallest position of a non-whitespace character in [position
, bound
), or NOT_FOUND
if none can be found
+ */
+ public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
+ return scanForward(position, bound, fNonWS);
+ }
+
+ /**
+ * Finds the highest position in fDocument
such that the position is <= position
+ * and > bound
and Character.isWhitespace(fDocument.getChar(pos))
evaluates to false
+ * and the position is in the default partition.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
< position
, or UNBOUND
+ * @return the highest position of a non-whitespace character in (bound
, position
] that resides in a C partition, or NOT_FOUND
if none can be found
+ */
+ public int findNonWhitespaceBackward(int position, int bound) {
+ return scanBackward(position, bound, fNonWSDefaultPart);
+ }
+
+ /**
+ * Finds the lowest position p
in fDocument
such that start
<= p <
+ * bound
and condition.stop(fDocument.getChar(p), p)
evaluates to true
.
+ *
+ * @param start the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
> start
, or UNBOUND
+ * @param condition the StopCondition
to check
+ * @return the lowest position in [start
, bound
) for which condition
holds, or NOT_FOUND
if none can be found
+ */
+ public int scanForward(int start, int bound, StopCondition condition) {
+ Assert.isLegal(start >= 0);
+
+ if (bound == UNBOUND)
+ bound= fDocument.getLength();
+
+ Assert.isLegal(bound <= fDocument.getLength());
+
+ try {
+ fPos= start;
+ while (fPos < bound) {
+
+ fChar= fDocument.getChar(fPos);
+ if (condition.stop(fChar, fPos, true))
+ return fPos;
+
+ fPos= condition.nextPosition(fPos, true);
+ }
+ } catch (BadLocationException e) {
+ }
+ return NOT_FOUND;
+ }
+
+
+ /**
+ * Finds the lowest position in fDocument
such that the position is >= position
+ * and < bound
and fDocument.getChar(position) == ch
evaluates to true
+ * and the position is in the default partition.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
> position
, or UNBOUND
+ * @param ch the char
to search for
+ * @return the lowest position of ch
in (bound
, position
] that resides in a C partition, or NOT_FOUND
if none can be found
+ */
+ public int scanForward(int position, int bound, char ch) {
+ return scanForward(position, bound, new CharacterMatch(ch));
+ }
+
+ /**
+ * Finds the lowest position in fDocument
such that the position is >= position
+ * and < bound
and fDocument.getChar(position) == ch
evaluates to true
for at least one
+ * ch in chars
and the position is in the default partition.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
> position
, or UNBOUND
+ * @param chars an array of char
to search for
+ * @return the lowest position of a non-whitespace character in [position
, bound
) that resides in a C partition, or NOT_FOUND
if none can be found
+ */
+ public int scanForward(int position, int bound, char[] chars) {
+ return scanForward(position, bound, new CharacterMatch(chars));
+ }
+
+ /**
+ * Finds the highest position p
in fDocument
such that bound
< p
<= start
+ * and condition.stop(fDocument.getChar(p), p)
evaluates to true
.
+ *
+ * @param start the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
< start
, or UNBOUND
+ * @param condition the StopCondition
to check
+ * @return the highest position in (bound
, start
for which condition
holds, or NOT_FOUND
if none can be found
+ */
+ public int scanBackward(int start, int bound, StopCondition condition) {
+ if (bound == UNBOUND)
+ bound= -1;
+
+ Assert.isLegal(bound >= -1);
+ Assert.isLegal(start < fDocument.getLength() );
+
+ try {
+ fPos= start;
+ while (fPos > bound) {
+
+ fChar= fDocument.getChar(fPos);
+ if (condition.stop(fChar, fPos, false))
+ return fPos;
+
+ fPos= condition.nextPosition(fPos, false);
+ }
+ } catch (BadLocationException e) {
+ }
+ return NOT_FOUND;
+ }
+
+ /**
+ * Finds the highest position in fDocument
such that the position is <= position
+ * and > bound
and fDocument.getChar(position) == ch
evaluates to true
for at least one
+ * ch in chars
and the position is in the default partition.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
< position
, or UNBOUND
+ * @param ch the char
to search for
+ * @return the highest position of one element in chars
in (bound
, position
] that resides in a C partition, or NOT_FOUND
if none can be found
+ */
+ public int scanBackward(int position, int bound, char ch) {
+ return scanBackward(position, bound, new CharacterMatch(ch));
+ }
+
+ /**
+ * Finds the highest position in fDocument
such that the position is <= position
+ * and > bound
and fDocument.getChar(position) == ch
evaluates to true
for at least one
+ * ch in chars
and the position is in the default partition.
+ *
+ * @param position the first character position in fDocument
to be considered
+ * @param bound the first position in fDocument
to not consider any more, with bound
< position
, or UNBOUND
+ * @param chars an array of char
to search for
+ * @return the highest position of one element in chars
in (bound
, position
] that resides in a C partition, or NOT_FOUND
if none can be found
+ */
+ public int scanBackward(int position, int bound, char[] chars) {
+ return scanBackward(position, bound, new CharacterMatch(chars));
+ }
+
+ /**
+ * Checks whether position
resides in a default (C) partition of fDocument
.
+ *
+ * @param position the position to be checked
+ * @return true
if position
is in the default partition of fDocument
, false
otherwise
+ */
+ public boolean isDefaultPartition(int position) {
+ return fPartition.equals(getPartition(position).getType());
+ }
+
+ /**
+ * Returns the partition at position
.
+ *
+ * @param position the position to get the partition for
+ * @return the partition at position
or a dummy zero-length
+ * partition if accessing the document fails
+ */
+ private ITypedRegion getPartition(int position) {
+ if (!contains(fCachedPartition, position)) {
+ Assert.isTrue(position >= 0);
+ Assert.isTrue(position <= fDocument.getLength());
+
+ try {
+ fCachedPartition= TextUtilities.getPartition(fDocument, fPartitioning, position, false);
+ } catch (BadLocationException e) {
+ fCachedPartition= new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
+ }
+ }
+
+ return fCachedPartition;
+ }
+
+ /**
+ * Returns true
if region
contains position
.
+ *
+ * @param region a region
+ * @param position an offset
+ * @return true
if region
contains position
+ */
+ private boolean contains(IRegion region, int position) {
+ int offset= region.getOffset();
+ return offset <= position && position < offset + region.getLength();
+ }
+
+ /**
+ * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while,
+ * or for statement with just one following statement, see example below).
+ *
+ * + * if (condition) + * doStuff(); + *+ * + *
Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition), + * for( expression), do, else, and there is no statement after that
+ * + * @param position the insert position of the new character + * @param bound the lowest position to consider + * @returntrue
if the code is a conditional statement or loop without a block, false
otherwise
+ */
+ public boolean isBracelessBlockStart(int position, int bound) {
+ if (position < 1)
+ return false;
+
+ switch (previousToken(position, bound)) {
+ case TokenDO:
+ case TokenELSE:
+ return true;
+ case TokenRPAREN:
+ position= findOpeningPeer(fPos, LPAREN, RPAREN);
+ if (position > 0) {
+ switch (previousToken(position - 1, bound)) {
+ case TokenIF:
+ case TokenFOR:
+ case TokenWHILE:
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns true
if the document, when scanned backwards from start
+ * appears to contain a class instance creation, i.e. a possibly qualified name preceded by a
+ * new
keyword. The start
must be at the end of the type name, and
+ * before any generic signature or constructor parameter list. The heuristic will return
+ * true
if start
is at the following positions (|):
+ *
+ * + * new java.util. ArrayList|<String>(10) + * new ArrayList |(10) + * new / * comment * / ArrayList |(10) + *+ * + * but not the following: + * + *
+ * new java.util. ArrayList<String>(10)| + * new java.util. ArrayList<String>|(10) + * new ArrayList (10)| + * ArrayList |(10) + *+ * + * @param start the position where the type name of the class instance creation supposedly ends + * @param bound the first position in
fDocument
to not consider any more, with
+ * bound
< start
, or UNBOUND
+ * @return true
if the current position looks like after the type name of a class
+ * instance creation
+ */
+ public boolean looksLikeClassInstanceCreationBackward(int start, int bound) {
+ int token= previousToken(start - 1, bound);
+ if (token == Symbols.TokenIDENT) { // type name
+ token= previousToken(getPosition(), bound);
+ while (token == Symbols.TokenOTHER) { // dot of qualification
+ token= previousToken(getPosition(), bound);
+ if (token != Symbols.TokenIDENT) // qualification name
+ return false;
+ token= previousToken(getPosition(), bound);
+ }
+ return token == Symbols.TokenNEW;
+ }
+ return false;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java
new file mode 100644
index 00000000000..652c2c0e00b
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java
@@ -0,0 +1,1615 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
+
+import org.eclipse.jface.text.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+
+
+/**
+ * Uses the {@link org.eclipse.cdt.internal.ui.text.CHeuristicScanner} to
+ * get the indentation level for a certain position in a document.
+ *
+ * + * An instance holds some internal position in the document and is therefore + * not threadsafe. + *
+ */ +public final class CIndenter { + + /** + * The CDT Core preferences. + */ + private final class CorePrefs { + final boolean prefUseTabs; + final int prefTabSize; + final int prefIndentationSize; + final boolean prefArrayDimensionsDeepIndent; + final int prefArrayIndent; + final boolean prefArrayDeepIndent; + final boolean prefTernaryDeepAlign; + final int prefTernaryIndent; + final int prefCaseIndent; + final int prefAssignmentIndent; + final int prefCaseBlockIndent; + final int prefSimpleIndent; + final int prefBracketIndent; + final boolean prefMethodDeclDeepIndent; + final int prefMethodDeclIndent; + final boolean prefMethodCallDeepIndent; + final int prefMethodCallIndent; + final boolean prefParenthesisDeepIndent; + final int prefParenthesisIndent; + final int prefBlockIndent; + final int prefMethodBodyIndent; + final int prefTypeIndent; + final boolean prefIndentBracesForBlocks; + final boolean prefIndentBracesForArrays; + final boolean prefIndentBracesForMethods; + final boolean prefIndentBracesForTypes; + final int prefContinuationIndent; + final boolean prefHasGenerics; + final String prefTabChar; + + private final ICProject fProject; + + /** + * Returns the possibly project-specific core preference defined underkey
.
+ *
+ * @param key the key of the preference
+ * @return the value of the preference
+ */
+ private String getCoreFormatterOption(String key) {
+ if (fProject == null)
+ return CCorePlugin.getOption(key);
+ return fProject.getOption(key, true);
+ }
+
+ CorePrefs(ICProject project) {
+ fProject= project;
+ prefUseTabs= prefUseTabs();
+ prefTabSize= prefTabSize();
+ prefIndentationSize= prefIndentationSize();
+ prefArrayDimensionsDeepIndent= prefArrayDimensionsDeepIndent();
+ prefContinuationIndent= prefContinuationIndent();
+ prefBlockIndent= prefBlockIndent();
+ prefArrayIndent= prefArrayIndent();
+ prefArrayDeepIndent= prefArrayDeepIndent();
+ prefTernaryDeepAlign= prefTernaryDeepAlign();
+ prefTernaryIndent= prefTernaryIndent();
+ prefCaseIndent= prefCaseIndent();
+ prefAssignmentIndent= prefAssignmentIndent();
+ prefCaseBlockIndent= prefCaseBlockIndent();
+ prefIndentBracesForBlocks= prefIndentBracesForBlocks();
+ prefSimpleIndent= prefSimpleIndent();
+ prefBracketIndent= prefBracketIndent();
+ prefMethodDeclDeepIndent= prefMethodDeclDeepIndent();
+ prefMethodDeclIndent= prefMethodDeclIndent();
+ prefMethodCallDeepIndent= prefMethodCallDeepIndent();
+ prefMethodCallIndent= prefMethodCallIndent();
+ prefParenthesisDeepIndent= prefParenthesisDeepIndent();
+ prefParenthesisIndent= prefParenthesisIndent();
+ prefMethodBodyIndent= prefMethodBodyIndent();
+ prefTypeIndent= prefTypeIndent();
+ prefIndentBracesForArrays= prefIndentBracesForArrays();
+ prefIndentBracesForMethods= prefIndentBracesForMethods();
+ prefIndentBracesForTypes= prefIndentBracesForTypes();
+ prefHasGenerics= hasGenerics();
+ prefTabChar= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_TAB_CHAR);
+ }
+
+ private boolean prefUseTabs() {
+ return !CCorePlugin.SPACE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_TAB_CHAR));
+ }
+
+ private int prefTabSize() {
+ return CodeFormatterUtil.getTabWidth(fProject);
+ }
+
+ private int prefIndentationSize() {
+ return CodeFormatterUtil.getIndentWidth(fProject);
+ }
+
+ private boolean prefArrayDimensionsDeepIndent() {
+ return true; // sensible default, no formatter setting
+ }
+
+ private int prefArrayIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return prefContinuationIndent(); // default
+ }
+
+ private boolean prefArrayDeepIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return true;
+ }
+
+ private boolean prefTernaryDeepAlign() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+ return false;
+ }
+
+ private int prefTernaryIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ else
+ return prefContinuationIndent();
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return prefContinuationIndent();
+ }
+
+ private int prefCaseIndent() {
+ if (CodeFormatterConstants.TRUE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH)))
+ return prefBlockIndent();
+ else
+ return 0;
+ }
+
+ private int prefAssignmentIndent() {
+ return prefBlockIndent();
+ }
+
+ private int prefCaseBlockIndent() {
+ if (true)
+ return prefBlockIndent();
+
+ if (CodeFormatterConstants.TRUE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES)))
+ return prefBlockIndent();
+ else
+ return 0;
+ }
+
+ private int prefSimpleIndent() {
+ if (prefIndentBracesForBlocks() && prefBlockIndent() == 0)
+ return 1;
+ else return prefBlockIndent();
+ }
+
+ private int prefBracketIndent() {
+ return prefBlockIndent();
+ }
+
+ private boolean prefMethodDeclDeepIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return true;
+ }
+
+ private int prefMethodDeclIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ else
+ return prefContinuationIndent();
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+ return 1;
+ }
+
+ private boolean prefMethodCallDeepIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+ return false; // sensible default
+ }
+
+ private int prefMethodCallIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
+ try {
+ if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
+ return 1;
+ else
+ return prefContinuationIndent();
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return 1; // sensible default
+ }
+
+ private boolean prefParenthesisDeepIndent() {
+ if (true) // don't do parenthesis deep indentation
+ return false;
+
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
+ try {
+ return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
+ } catch (IllegalArgumentException e) {
+ // ignore and return default
+ }
+
+ return false; // sensible default
+ }
+
+ private int prefParenthesisIndent() {
+ return prefContinuationIndent();
+ }
+
+ private int prefBlockIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK);
+ if (CodeFormatterConstants.FALSE.equals(option))
+ return 0;
+
+ return 1; // sensible default
+ }
+
+ private int prefMethodBodyIndent() {
+ if (CodeFormatterConstants.FALSE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY)))
+ return 0;
+
+ return 1; // sensible default
+ }
+
+ private int prefTypeIndent() {
+ String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER);
+ if (CodeFormatterConstants.FALSE.equals(option))
+ return 0;
+
+ return 1; // sensible default
+ }
+
+ private boolean prefIndentBracesForBlocks() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK));
+ }
+
+ private boolean prefIndentBracesForArrays() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER));
+ }
+
+ private boolean prefIndentBracesForMethods() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION));
+ }
+
+ private boolean prefIndentBracesForTypes() {
+ return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION));
+ }
+
+ private int prefContinuationIndent() {
+ try {
+ return Integer.parseInt(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION));
+ } catch (NumberFormatException e) {
+ // ignore and return default
+ }
+
+ return 2; // sensible default
+ }
+ private boolean hasGenerics() {
+ return true;
+ }
+ }
+
+ /** The document being scanned. */
+ private final IDocument fDocument;
+ /** The indentation accumulated by findReferencePosition
. */
+ private int fIndent;
+ /**
+ * The absolute (character-counted) indentation offset for special cases
+ * (method defs, array initializers)
+ */
+ private int fAlign;
+ /** The stateful scanposition for the indentation methods. */
+ private int fPosition;
+ /** The previous position. */
+ private int fPreviousPos;
+ /** The most recent token. */
+ private int fToken;
+ /** The line of fPosition
. */
+ private int fLine;
+ /**
+ * The scanner we will use to scan the document. It has to be installed
+ * on the same document as the one we get.
+ */
+ private final CHeuristicScanner fScanner;
+ /**
+ * The CDT Core preferences.
+ */
+ private final CorePrefs fPrefs;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document to scan
+ * @param scanner the {@link CHeuristicScanner} to be used for scanning
+ * the document. It must be installed on the same IDocument
.
+ */
+ public CIndenter(IDocument document, CHeuristicScanner scanner) {
+ this(document, scanner, null);
+ }
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document to scan
+ * @param scanner the {@link CHeuristicScanner} to be used for scanning
+ * the document. It must be installed on the same
+ * IDocument
.
+ * @param project the C/C++ project to get the formatter preferences from, or
+ * null
to use the workspace settings
+ */
+ public CIndenter(IDocument document, CHeuristicScanner scanner, ICProject project) {
+ Assert.isNotNull(document);
+ Assert.isNotNull(scanner);
+ fDocument= document;
+ fScanner= scanner;
+ fPrefs= new CorePrefs(project);
+ }
+
+ /**
+ * Computes the indentation at the reference point of position
.
+ *
+ * @param offset the offset in the document
+ * @return a String which reflects the indentation at the line in which the
+ * reference position to offset
resides, or null
+ * if it cannot be determined
+ */
+ public StringBuffer getReferenceIndentation(int offset) {
+ return getReferenceIndentation(offset, false);
+ }
+
+ /**
+ * Computes the indentation at the reference point of position
.
+ *
+ * @param offset the offset in the document
+ * @param assumeOpeningBrace true
if an opening brace should be assumed
+ * @return a String which reflects the indentation at the line in which the
+ * reference position to offset
resides, or null
+ * if it cannot be determined
+ */
+ private StringBuffer getReferenceIndentation(int offset, boolean assumeOpeningBrace) {
+
+ int unit;
+ if (assumeOpeningBrace)
+ unit= findReferencePosition(offset, Symbols.TokenLBRACE);
+ else
+ unit= findReferencePosition(offset, peekChar(offset));
+
+ // if we were unable to find anything, return null
+ if (unit == CHeuristicScanner.NOT_FOUND)
+ return null;
+
+ return getLeadingWhitespace(unit);
+
+ }
+
+ /**
+ * Computes the indentation at offset
.
+ *
+ * @param offset the offset in the document
+ * @return a String which reflects the correct indentation for the line in
+ * which offset resides, or null
if it cannot be
+ * determined
+ */
+ public StringBuffer computeIndentation(int offset) {
+ return computeIndentation(offset, false);
+ }
+
+ /**
+ * Computes the indentation at offset
.
+ *
+ * @param offset the offset in the document
+ * @param assumeOpeningBrace true
if an opening brace should be assumed
+ * @return a String which reflects the correct indentation for the line in
+ * which offset resides, or null
if it cannot be
+ * determined
+ */
+ public StringBuffer computeIndentation(int offset, boolean assumeOpeningBrace) {
+
+ StringBuffer reference= getReferenceIndentation(offset, assumeOpeningBrace);
+
+ // handle special alignment
+ if (fAlign != CHeuristicScanner.NOT_FOUND) {
+ try {
+ // a special case has been detected.
+ IRegion line= fDocument.getLineInformationOfOffset(fAlign);
+ int lineOffset= line.getOffset();
+ return createIndent(lineOffset, fAlign, false);
+ } catch (BadLocationException e) {
+ return null;
+ }
+ }
+
+ if (reference == null)
+ return null;
+
+ // add additional indent
+ return createReusingIndent(reference, fIndent);
+ }
+
+ /**
+ * Computes the length of a CharacterSequence
, counting
+ * a tab character as the size until the next tab stop and every other
+ * character as one.
+ *
+ * @param indent the string to measure
+ * @return the visual length in characters
+ */
+ private int computeVisualLength(CharSequence indent) {
+ final int tabSize= fPrefs.prefTabSize;
+ int length= 0;
+ for (int i= 0; i < indent.length(); i++) {
+ char ch= indent.charAt(i);
+ switch (ch) {
+ case '\t':
+ if (tabSize > 0) {
+ int reminder= length % tabSize;
+ length += tabSize - reminder;
+ }
+ break;
+ case ' ':
+ length++;
+ break;
+ }
+ }
+ return length;
+ }
+
+ /**
+ * Strips any characters off the end of reference
that exceed
+ * indentLength
.
+ *
+ * @param reference the string to measure
+ * @param indentLength the maximum visual indentation length
+ * @return the stripped reference
+ */
+ private StringBuffer stripExceedingChars(StringBuffer reference, int indentLength) {
+ final int tabSize= fPrefs.prefTabSize;
+ int measured= 0;
+ int chars= reference.length();
+ int i= 0;
+ for (; measured < indentLength && i < chars; i++) {
+ char ch= reference.charAt(i);
+ switch (ch) {
+ case '\t':
+ if (tabSize > 0) {
+ int reminder= measured % tabSize;
+ measured += tabSize - reminder;
+ }
+ break;
+ case ' ':
+ measured++;
+ break;
+ }
+ }
+ int deleteFrom= measured > indentLength ? i - 1 : i;
+
+ return reference.delete(deleteFrom, chars);
+ }
+
+ /**
+ * Returns the indentation of the line at offset
as a
+ * StringBuffer
. If the offset is not valid, the empty string
+ * is returned.
+ *
+ * @param offset the offset in the document
+ * @return the indentation (leading whitespace) of the line in which
+ * offset
is located
+ */
+ private StringBuffer getLeadingWhitespace(int offset) {
+ StringBuffer indent= new StringBuffer();
+ try {
+ IRegion line= fDocument.getLineInformationOfOffset(offset);
+ int lineOffset= line.getOffset();
+ int nonWS= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, lineOffset + line.getLength());
+ indent.append(fDocument.get(lineOffset, nonWS - lineOffset));
+ return indent;
+ } catch (BadLocationException e) {
+ return indent;
+ }
+ }
+
+ /**
+ * Creates an indentation string of the length indent - start, consisting of
+ * the content in fDocument
in the range [start, indent),
+ * with every character replaced by a space except for tabs, which are kept
+ * as such.
+ *
+ * If convertSpaceRunsToTabs
is true
, every
+ * run of the number of spaces that make up a tab are replaced by a tab
+ * character. If it is not set, no conversion takes place, but tabs in the
+ * original range are still copied verbatim.
+ *
start
and indent
+ */
+ private StringBuffer createIndent(int start, final int indent, final boolean convertSpaceRunsToTabs) {
+ final boolean convertTabs= fPrefs.prefUseTabs && convertSpaceRunsToTabs;
+ final int tabLen= fPrefs.prefTabSize;
+ final StringBuffer ret= new StringBuffer();
+ try {
+ int spaces= 0;
+ while (start < indent) {
+
+ char ch= fDocument.getChar(start);
+ if (ch == '\t') {
+ ret.append('\t');
+ spaces= 0;
+ } else if (convertTabs) {
+ spaces++;
+ if (spaces == tabLen) {
+ ret.append('\t');
+ spaces= 0;
+ }
+ } else {
+ ret.append(' ');
+ }
+
+ start++;
+ }
+ // remainder
+ while (spaces-- > 0)
+ ret.append(' ');
+
+ } catch (BadLocationException e) {
+ }
+
+ return ret;
+ }
+
+ /**
+ * Creates a string with a visual length of the given
+ * indentationSize
.
+ *
+ * @param buffer the original indent to reuse if possible
+ * @param additional the additional indentation units to add or subtract to
+ * reference
+ * @return the modified buffer
reflecting the indentation
+ * adapted to additional
+ */
+ private StringBuffer createReusingIndent(StringBuffer buffer, int additional) {
+ int refLength= computeVisualLength(buffer);
+ int addLength= fPrefs.prefIndentationSize * additional; // may be < 0
+ int totalLength= Math.max(0, refLength + addLength);
+
+
+ // copy the reference indentation for the indent up to the last tab
+ // stop within the maxCopy area
+ int minLength= Math.min(totalLength, refLength);
+ int tabSize= fPrefs.prefTabSize;
+ int maxCopyLength= tabSize > 0 ? minLength - minLength % tabSize : minLength; // maximum indent to copy
+ stripExceedingChars(buffer, maxCopyLength);
+
+
+ // add additional indent
+ int missing= totalLength - maxCopyLength;
+ final int tabs, spaces;
+ if (CCorePlugin.SPACE.equals(fPrefs.prefTabChar)) {
+ tabs= 0;
+ spaces= missing;
+ } else if (CCorePlugin.TAB.equals(fPrefs.prefTabChar)) {
+ tabs= tabSize > 0 ? missing / tabSize : 0;
+ spaces= tabSize > 0 ? missing % tabSize : missing;
+ } else if (CodeFormatterConstants.MIXED.equals(fPrefs.prefTabChar)) {
+ tabs= tabSize > 0 ? missing / tabSize : 0;
+ spaces= tabSize > 0 ? missing % tabSize : missing;
+ } else {
+ Assert.isTrue(false);
+ return null;
+ }
+ for(int i= 0; i < tabs; i++)
+ buffer.append('\t');
+ for(int i= 0; i < spaces; i++)
+ buffer.append(' ');
+ return buffer;
+ }
+
+ /**
+ * Returns the reference position regarding to indentation for offset
,
+ * or NOT_FOUND
. This method calls
+ * {@link #findReferencePosition(int, int) findReferencePosition(offset, nextChar)} where
+ * nextChar
is the next character after offset
.
+ *
+ * @param offset the offset for which the reference is computed
+ * @return the reference statement relative to which offset
+ * should be indented, or {@link CHeuristicScanner#NOT_FOUND}
+ */
+ public int findReferencePosition(int offset) {
+ return findReferencePosition(offset, peekChar(offset));
+ }
+
+ /**
+ * Peeks the next char in the document that comes after offset
+ * on the same line as offset
.
+ *
+ * @param offset the offset into document
+ * @return the token symbol of the next element, or TokenEOF if there is none
+ */
+ private int peekChar(int offset) {
+ if (offset < fDocument.getLength()) {
+ try {
+ IRegion line= fDocument.getLineInformationOfOffset(offset);
+ int lineOffset= line.getOffset();
+ int next= fScanner.nextToken(offset, lineOffset + line.getLength());
+ return next;
+ } catch (BadLocationException e) {
+ }
+ }
+ return Symbols.TokenEOF;
+ }
+
+ /**
+ * Returns the reference position regarding to indentation for position
,
+ * or NOT_FOUND
.
+ *
+ * If peekNextChar
is true
, the next token after
+ * offset
is read and taken into account when computing the
+ * indentation. Currently, if the next token is the first token on the line
+ * (i.e. only preceded by whitespace), the following tokens are specially
+ * handled:
+ *
switch
labels are indented relative to the switch blockelse
keyword is aligned with its if
, anything
+ * else is aligned normally (i.e. with the base of any introducing statements).offset
, the indentation
+ * is the same as for an else
keywordoffset
+ * should be indented, or {@link CHeuristicScanner#NOT_FOUND}
+ */
+ public int findReferencePosition(int offset, int nextToken) {
+ boolean danglingElse= false;
+ boolean unindent= false;
+ boolean indent= false;
+ boolean matchBrace= false;
+ boolean matchParen= false;
+ boolean matchCase= false;
+
+ // account for un-indentation characters already typed in, but after position
+ // if they are on a line by themselves, the indentation gets adjusted
+ // accordingly
+ //
+ // also account for a dangling else
+ if (offset < fDocument.getLength()) {
+ try {
+ IRegion line= fDocument.getLineInformationOfOffset(offset);
+ int lineOffset= line.getOffset();
+ int prevPos= Math.max(offset - 1, 0);
+ boolean isFirstTokenOnLine= fDocument.get(lineOffset, prevPos + 1 - lineOffset).trim().length() == 0;
+ int prevToken= fScanner.previousToken(prevPos, CHeuristicScanner.UNBOUND);
+ boolean bracelessBlockStart= fScanner.isBracelessBlockStart(prevPos, CHeuristicScanner.UNBOUND);
+
+ switch (nextToken) {
+ case Symbols.TokenELSE:
+ danglingElse= true;
+ break;
+ case Symbols.TokenCASE:
+ case Symbols.TokenDEFAULT:
+ if (isFirstTokenOnLine)
+ matchCase= true;
+ break;
+ case Symbols.TokenLBRACE: // for opening-brace-on-new-line style
+ if (bracelessBlockStart && !fPrefs.prefIndentBracesForBlocks)
+ unindent= true;
+ else if ((prevToken == Symbols.TokenCOLON || prevToken == Symbols.TokenEQUAL || prevToken == Symbols.TokenRBRACKET) && !fPrefs.prefIndentBracesForArrays)
+ unindent= true;
+ else if (!bracelessBlockStart && fPrefs.prefIndentBracesForMethods)
+ indent= true;
+ break;
+ case Symbols.TokenRBRACE: // closing braces get unindented
+ if (isFirstTokenOnLine)
+ matchBrace= true;
+ break;
+ case Symbols.TokenRPAREN:
+ if (isFirstTokenOnLine)
+ matchParen= true;
+ break;
+ }
+ } catch (BadLocationException e) {
+ }
+ } else {
+ // don't assume an else could come if we are at the end of file
+ danglingElse= false;
+ }
+
+ int ref= findReferencePosition(offset, danglingElse, matchBrace, matchParen, matchCase);
+ if (unindent)
+ fIndent--;
+ if (indent)
+ fIndent++;
+ return ref;
+ }
+
+ /**
+ * Returns the reference position regarding to indentation for position
,
+ * or NOT_FOUND
.fIndent
will contain the
+ * relative indentation (in indentation units, not characters) after the
+ * call. If there is a special alignment (e.g. for a method declaration
+ * where parameters should be aligned), fAlign
will contain
+ * the absolute position of the alignment reference in fDocument
,
+ * otherwise fAlign
is set to CHeuristicScanner.NOT_FOUND
.
+ *
+ * @param offset the offset for which the reference is computed
+ * @param danglingElse whether a dangling else should be assumed at position
+ * @param matchBrace whether the position of the matching brace should be
+ * returned instead of doing code analysis
+ * @param matchParen whether the position of the matching parenthesis
+ * should be returned instead of doing code analysis
+ * @param matchCase whether the position of a switch statement reference
+ * should be returned (either an earlier case statement or the
+ * switch block brace)
+ * @return the reference statement relative to which position
+ * should be indented, or {@link CHeuristicScanner#NOT_FOUND}
+ */
+ public int findReferencePosition(int offset, boolean danglingElse, boolean matchBrace, boolean matchParen, boolean matchCase) {
+ fIndent= 0; // the indentation modification
+ fAlign= CHeuristicScanner.NOT_FOUND;
+ fPosition= offset;
+
+ // forward cases
+ // an unindentation happens sometimes if the next token is special, namely on braces, parens and case labels
+ // align braces, but handle the case where we align with the method declaration start instead of
+ // the opening brace.
+ if (matchBrace) {
+ if (skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE)) {
+ try {
+ // align with the opening brace that is on a line by its own
+ int lineOffset= fDocument.getLineOffset(fLine);
+ if (lineOffset <= fPosition && fDocument.get(lineOffset, fPosition - lineOffset).trim().length() == 0)
+ return fPosition;
+ } catch (BadLocationException e) {
+ // concurrent modification - walk default path
+ }
+ // if the opening brace is not on the start of the line, skip to the start
+ int pos= skipToStatementStart(true, true);
+ fIndent= 0; // indent is aligned with reference position
+ return pos;
+ } else {
+ // if we can't find the matching brace, the heuristic is to unindent
+ // by one against the normal position
+ int pos= findReferencePosition(offset, danglingElse, false, matchParen, matchCase);
+ fIndent--;
+ return pos;
+ }
+ }
+
+ // align parenthesis'
+ if (matchParen) {
+ if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN))
+ return fPosition;
+ else {
+ // if we can't find the matching paren, the heuristic is to unindent
+ // by one against the normal position
+ int pos= findReferencePosition(offset, danglingElse, matchBrace, false, matchCase);
+ fIndent--;
+ return pos;
+ }
+ }
+
+ // the only reliable way to get case labels aligned (due to many different styles of using braces in a block)
+ // is to go for another case statement, or the scope opening brace
+ if (matchCase) {
+ return matchCaseAlignment();
+ }
+
+ nextToken();
+ switch (fToken) {
+ case Symbols.TokenGREATERTHAN:
+ case Symbols.TokenRBRACE:
+ // skip the block and fall through
+ // if we can't complete the scope, reset the scan position
+ int pos= fPosition;
+ if (!skipScope())
+ fPosition= pos;
+ case Symbols.TokenSEMICOLON:
+ // this is the 90% case: after a statement block
+ // the end of the previous statement / block previous.end
+ // search to the end of the statement / block before the previous; the token just after that is previous.start
+ return skipToStatementStart(danglingElse, false);
+
+ // scope introduction: special treat who special is
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ return handleScopeIntroduction(offset + 1);
+
+ case Symbols.TokenEOF:
+ // trap when hitting start of document
+ return CHeuristicScanner.NOT_FOUND;
+
+ case Symbols.TokenEQUAL:
+ // indent assignments
+ fIndent= fPrefs.prefAssignmentIndent;
+ return fPosition;
+
+ case Symbols.TokenCOLON:
+ // TODO handle ternary deep indentation
+ fIndent= fPrefs.prefCaseBlockIndent;
+ return fPosition;
+
+ case Symbols.TokenQUESTIONMARK:
+ if (fPrefs.prefTernaryDeepAlign) {
+ setFirstElementAlignment(fPosition, offset + 1);
+ return fPosition;
+ } else {
+ fIndent= fPrefs.prefTernaryIndent;
+ return fPosition;
+ }
+
+ // indentation for blockless introducers:
+ case Symbols.TokenDO:
+ case Symbols.TokenWHILE:
+ case Symbols.TokenELSE:
+ fIndent= fPrefs.prefSimpleIndent;
+ return fPosition;
+
+ case Symbols.TokenTRY:
+ return skipToStatementStart(danglingElse, false);
+ case Symbols.TokenRPAREN:
+ int line= fLine;
+ if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN)) {
+ int scope= fPosition;
+ nextToken();
+ if (fToken == Symbols.TokenIF || fToken == Symbols.TokenWHILE || fToken == Symbols.TokenFOR) {
+ fIndent= fPrefs.prefSimpleIndent;
+ return fPosition;
+ }
+ fPosition= scope;
+ if (looksLikeMethodDecl()) {
+ return skipToStatementStart(danglingElse, false);
+ }
+ if (fToken == Symbols.TokenCATCH) {
+ return skipToStatementStart(danglingElse, false);
+ }
+ fPosition= scope;
+ if (looksLikeAnonymousTypeDecl()) {
+ return skipToStatementStart(danglingElse, false);
+ }
+ }
+ // restore
+ fPosition= offset;
+ fLine= line;
+ // else: fall through to default
+
+ case Symbols.TokenCOMMA:
+ // inside a list of some type
+ // easy if there is already a list item before with its own indentation - we just align
+ // if not: take the start of the list ( LPAREN, LBRACE, LBRACKET ) and either align or
+ // indent by list-indent
+ default:
+ // inside whatever we don't know about: similar to the list case:
+ // if we are inside a continued expression, then either align with a previous line that has indentation
+ // or indent from the expression start line (either a scope introducer or the start of the expr).
+ return skipToPreviousListItemOrListStart();
+
+ }
+ }
+
+ /**
+ * Skips to the start of a statement that ends at the current position.
+ *
+ * @param danglingElse whether to indent aligned with the last if
+ * @param isInBlock whether the current position is inside a block, which limits the search scope to the next scope introducer
+ * @return the reference offset of the start of the statement
+ */
+ private int skipToStatementStart(boolean danglingElse, boolean isInBlock) {
+ final int NOTHING= 0;
+ final int READ_PARENS= 1;
+ final int READ_IDENT= 2;
+ int mayBeMethodBody= NOTHING;
+ boolean isTypeBody= false;
+ while (true) {
+ nextToken();
+
+ if (isInBlock) {
+ switch (fToken) {
+ // exit on all block introducers
+ case Symbols.TokenIF:
+ case Symbols.TokenELSE:
+ case Symbols.TokenCATCH:
+ case Symbols.TokenDO:
+ case Symbols.TokenWHILE:
+ case Symbols.TokenFOR:
+ case Symbols.TokenTRY:
+ return fPosition;
+
+ case Symbols.TokenSTATIC:
+ mayBeMethodBody= READ_IDENT; // treat static blocks like methods
+ break;
+
+ case Symbols.TokenCLASS:
+ case Symbols.TokenENUM:
+ isTypeBody= true;
+ break;
+
+ case Symbols.TokenSWITCH:
+ fIndent= fPrefs.prefCaseIndent;
+ return fPosition;
+ }
+ }
+
+ switch (fToken) {
+ // scope introduction through: LPAREN, LBRACE, LBRACKET
+ // search stop on SEMICOLON, RBRACE, COLON, EOF
+ // -> the next token is the start of the statement (i.e. previousPos when backward scanning)
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ case Symbols.TokenSEMICOLON:
+ case Symbols.TokenEOF:
+ if (isInBlock)
+ fIndent= getBlockIndent(mayBeMethodBody == READ_IDENT, isTypeBody);
+ // else: fIndent set by previous calls
+ return fPreviousPos;
+
+ case Symbols.TokenCOLON:
+ int pos= fPreviousPos;
+ if (!isConditional())
+ return pos;
+ break;
+
+ case Symbols.TokenRBRACE:
+ // RBRACE is a little tricky: it can be the end of an array definition, but
+ // usually it is the end of a previous block
+ pos= fPreviousPos; // store state
+ if (skipScope() && looksLikeArrayInitializerIntro()) {
+ continue; // it's an array
+ } else {
+ if (isInBlock)
+ fIndent= getBlockIndent(mayBeMethodBody == READ_IDENT, isTypeBody);
+ return pos; // it's not - do as with all the above
+ }
+
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ if (isInBlock)
+ mayBeMethodBody= READ_PARENS;
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenGREATERTHAN:
+ pos= fPreviousPos;
+ if (skipScope())
+ break;
+ else
+ return pos;
+
+ // IF / ELSE: align the position after the conditional block with the if
+ // so we are ready for an else, except if danglingElse is false
+ // in order for this to work, we must skip an else to its if
+ case Symbols.TokenIF:
+ if (danglingElse)
+ return fPosition;
+ else
+ break;
+ case Symbols.TokenELSE:
+ // skip behind the next if, as we have that one covered
+ pos= fPosition;
+ if (skipNextIF())
+ break;
+ else
+ return pos;
+
+ case Symbols.TokenDO:
+ // align the WHILE position with its do
+ return fPosition;
+
+ case Symbols.TokenWHILE:
+ // this one is tricky: while can be the start of a while loop
+ // or the end of a do - while
+ pos= fPosition;
+ if (hasMatchingDo()) {
+ // continue searching from the DO on
+ break;
+ } else {
+ // continue searching from the WHILE on
+ fPosition= pos;
+ break;
+ }
+ case Symbols.TokenIDENT:
+ if (mayBeMethodBody == READ_PARENS)
+ mayBeMethodBody= READ_IDENT;
+ break;
+
+ default:
+ // keep searching
+
+ }
+
+ }
+ }
+
+ private int getBlockIndent(boolean isMethodBody, boolean isTypeBody) {
+ if (isTypeBody)
+ return fPrefs.prefTypeIndent + (fPrefs.prefIndentBracesForTypes ? 1 : 0);
+ else if (isMethodBody)
+ return fPrefs.prefMethodBodyIndent + (fPrefs.prefIndentBracesForMethods ? 1 : 0);
+ else
+ return fIndent;
+ }
+
+ /**
+ * Returns true if the colon at the current position is part of a conditional
+ * (ternary) expression, false otherwise.
+ *
+ * @return true if the colon at the current position is part of a conditional
+ */
+ private boolean isConditional() {
+ while (true) {
+ nextToken();
+ switch (fToken) {
+
+ // search for case labels, which consist of (possibly qualified) identifiers or numbers
+ case Symbols.TokenIDENT:
+ case Symbols.TokenOTHER: // dots for qualified constants
+ continue;
+ case Symbols.TokenCASE:
+ return false;
+
+ default:
+ return true;
+ }
+ }
+ }
+
+ /**
+ * Returns as a reference any previous switch
labels (case
+ * or default
) or the offset of the brace that scopes the switch
+ * statement. Sets fIndent
to prefCaseIndent
upon
+ * a match.
+ *
+ * @return the reference offset for a switch
label
+ */
+ private int matchCaseAlignment() {
+ while (true) {
+ nextToken();
+ switch (fToken) {
+ // invalid cases: another case label or an LBRACE must come before a case
+ // -> bail out with the current position
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACKET:
+ case Symbols.TokenEOF:
+ return fPosition;
+ case Symbols.TokenLBRACE:
+ // opening brace of switch statement
+ fIndent= fPrefs.prefCaseIndent;
+ return fPosition;
+ case Symbols.TokenCASE:
+ case Symbols.TokenDEFAULT:
+ // align with previous label
+ fIndent= 0;
+ return fPosition;
+
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenRBRACE:
+ case Symbols.TokenGREATERTHAN:
+ skipScope();
+ break;
+
+ default:
+ // keep searching
+ continue;
+
+ }
+ }
+ }
+
+ /**
+ * Returns the reference position for a list element. The algorithm
+ * tries to match any previous indentation on the same list. If there is none,
+ * the reference position returned is determined depending on the type of list:
+ * The indentation will either match the list scope introducer (e.g. for
+ * method declarations), so called deep indents, or simply increase the
+ * indentation by a number of standard indents. See also {@link #handleScopeIntroduction(int)}.
+ *
+ * @return the reference position for a list item: either a previous list item
+ * that has its own indentation, or the list introduction start.
+ */
+ private int skipToPreviousListItemOrListStart() {
+ int startLine= fLine;
+ int startPosition= fPosition;
+ while (true) {
+ nextToken();
+
+ // if any line item comes with its own indentation, adapt to it
+ if (fLine < startLine) {
+ try {
+ int lineOffset= fDocument.getLineOffset(startLine);
+ int bound= Math.min(fDocument.getLength(), startPosition + 1);
+ fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, bound);
+ } catch (BadLocationException e) {
+ // ignore and return just the position
+ }
+ return startPosition;
+ }
+
+ switch (fToken) {
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenRBRACE:
+ case Symbols.TokenGREATERTHAN:
+ skipScope();
+ break;
+
+ // scope introduction: special treat who special is
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ return handleScopeIntroduction(startPosition + 1);
+
+ case Symbols.TokenSEMICOLON:
+ return fPosition;
+ case Symbols.TokenQUESTIONMARK:
+ if (fPrefs.prefTernaryDeepAlign) {
+ setFirstElementAlignment(fPosition - 1, fPosition + 1);
+ return fPosition;
+ } else {
+ fIndent= fPrefs.prefTernaryIndent;
+ return fPosition;
+ }
+ case Symbols.TokenEOF:
+ return 0;
+
+ }
+ }
+ }
+
+ /**
+ * Skips a scope and positions the cursor (fPosition
) on the
+ * token that opens the scope. Returns true
if a matching peer
+ * could be found, false
otherwise. The current token when calling
+ * must be one out of Symbols.TokenRPAREN
, Symbols.TokenRBRACE
,
+ * and Symbols.TokenRBRACKET
.
+ *
+ * @return true
if a matching peer was found, false
otherwise
+ */
+ private boolean skipScope() {
+ switch (fToken) {
+ case Symbols.TokenRPAREN:
+ return skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN);
+ case Symbols.TokenRBRACKET:
+ return skipScope(Symbols.TokenLBRACKET, Symbols.TokenRBRACKET);
+ case Symbols.TokenRBRACE:
+ return skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE);
+ case Symbols.TokenGREATERTHAN:
+ if (!fPrefs.prefHasGenerics)
+ return false;
+ int storedPosition= fPosition;
+ int storedToken= fToken;
+ nextToken();
+ switch (fToken) {
+ case Symbols.TokenIDENT:
+ if (!isGenericStarter(getTokenContent()))
+ break;
+ case Symbols.TokenQUESTIONMARK:
+ case Symbols.TokenGREATERTHAN:
+ if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
+ return true;
+ }
+ // <> are harder to detect - restore the position if we fail
+ fPosition= storedPosition;
+ fToken= storedToken;
+ return false;
+
+ default:
+ Assert.isTrue(false);
+ return false;
+ }
+ }
+
+ /**
+ * Returns the contents of the current token.
+ *
+ * @return the contents of the current token
+ */
+ private CharSequence getTokenContent() {
+ return new DocumentCharacterIterator(fDocument, fPosition, fPreviousPos);
+ }
+
+ /**
+ * Returns true
if identifier
is probably a
+ * type variable or type name, false
if it is rather not.
+ * This is a heuristic.
+ *
+ * @param identifier the identifier to check
+ * @return true
if identifier
is probably a
+ * type variable or type name, false
if not
+ */
+ private boolean isGenericStarter(CharSequence identifier) {
+ /* This heuristic allows any identifiers if they start with an upper
+ * case. This will fail when a comparison is made with constants:
+ *
+ * if (MAX > foo)
+ *
+ * will try to find the matching '<' which will never come
+ *
+ * Also, it will fail on lower case types and type variables
+ */
+ int length= identifier.length();
+ if (length > 0 && Character.isUpperCase(identifier.charAt(0))) {
+ for (int i= 0; i < length; i++) {
+ if (identifier.charAt(i) == '_')
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Handles the introduction of a new scope. The current token must be one out
+ * of Symbols.TokenLPAREN
, Symbols.TokenLBRACE
,
+ * and Symbols.TokenLBRACKET
. Returns as the reference position
+ * either the token introducing the scope or - if available - the first
+ * token after that.
+ *
+ * Depending on the type of scope introduction, the indentation will align
+ * (deep indenting) with the reference position (fAlign
will be
+ * set to the reference position) or fIndent
will be set to
+ * the number of indentation units.
+ *
fAlign
) to either the offset
+ * right after scopeIntroducerOffset
or - if available - the
+ * first C token after scopeIntroducerOffset
, but before
+ * bound
.
+ *
+ * @param scopeIntroducerOffset the offset of the scope introducer
+ * @param bound the bound for the search for another element
+ * @return the reference position
+ */
+ private int setFirstElementAlignment(int scopeIntroducerOffset, int bound) {
+ int firstPossible= scopeIntroducerOffset + 1; // align with the first position after the scope intro
+ fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(firstPossible, bound);
+ if (fAlign == CHeuristicScanner.NOT_FOUND)
+ fAlign= firstPossible;
+ return fAlign;
+ }
+
+
+ /**
+ * Returns true
if the next token received after calling
+ * nextToken
is either an equal sign or an array designator ('[]').
+ *
+ * @return true
if the next elements look like the start of an array definition
+ */
+ private boolean looksLikeArrayInitializerIntro() {
+ nextToken();
+ if (fToken == Symbols.TokenEQUAL || skipBrackets()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Skips over the next if
keyword. The current token when calling
+ * this method must be an else
keyword. Returns true
+ * if a matching if
could be found, false
otherwise.
+ * The cursor (fPosition
) is set to the offset of the if
+ * token.
+ *
+ * @return true
if a matching if
token was found, false
otherwise
+ */
+ private boolean skipNextIF() {
+ Assert.isTrue(fToken == Symbols.TokenELSE);
+
+ while (true) {
+ nextToken();
+ switch (fToken) {
+ // scopes: skip them
+ case Symbols.TokenRPAREN:
+ case Symbols.TokenRBRACKET:
+ case Symbols.TokenRBRACE:
+ case Symbols.TokenGREATERTHAN:
+ skipScope();
+ break;
+
+ case Symbols.TokenIF:
+ // found it, return
+ return true;
+ case Symbols.TokenELSE:
+ // recursively skip else-if blocks
+ skipNextIF();
+ break;
+
+ // shortcut scope starts
+ case Symbols.TokenLPAREN:
+ case Symbols.TokenLBRACE:
+ case Symbols.TokenLBRACKET:
+ case Symbols.TokenEOF:
+ return false;
+ }
+ }
+ }
+
+
+ /**
+ * while(condition); is ambiguous when parsed backwardly, as it is a valid
+ * statement by its own, so we have to check whether there is a matching
+ * do. A do
can either be separated from the while by a
+ * block, or by a single statement, which limits our search distance.
+ *
+ * @return true
if the while
currently in
+ * fToken
has a matching do
.
+ */
+ private boolean hasMatchingDo() {
+ Assert.isTrue(fToken == Symbols.TokenWHILE);
+ nextToken();
+ switch (fToken) {
+ case Symbols.TokenRBRACE:
+ skipScope(); // and fall thru
+ case Symbols.TokenSEMICOLON:
+ skipToStatementStart(false, false);
+ return fToken == Symbols.TokenDO;
+ }
+ return false;
+ }
+
+ /**
+ * Skips brackets if the current token is a RBRACKET. There can be nothing
+ * but whitespace in between, this is only to be used for []
elements.
+ *
+ * @return true
if a []
could be scanned, the
+ * current token is left at the LBRACKET.
+ */
+ private boolean skipBrackets() {
+ if (fToken == Symbols.TokenRBRACKET) {
+ nextToken();
+ if (fToken == Symbols.TokenLBRACKET) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Reads the next token in backward direction from the heuristic scanner
+ * and sets the fields fToken, fPreviousPosition
and fPosition
+ * accordingly.
+ */
+ private void nextToken() {
+ nextToken(fPosition);
+ }
+
+ /**
+ * Reads the next token in backward direction of start
from
+ * the heuristic scanner and sets the fields fToken, fPreviousPosition
+ * and fPosition
accordingly.
+ *
+ * @param start the start offset from which to scan backwards
+ */
+ private void nextToken(int start) {
+ fToken= fScanner.previousToken(start - 1, CHeuristicScanner.UNBOUND);
+ fPreviousPos= start;
+ fPosition= fScanner.getPosition() + 1;
+ try {
+ fLine= fDocument.getLineOfOffset(fPosition);
+ } catch (BadLocationException e) {
+ fLine= -1;
+ }
+ }
+
+ /**
+ * Returns true
if the current tokens look like a method
+ * declaration header (i.e. only the return type and method name). The
+ * heuristic calls nextToken
and expects an identifier
+ * (method name) and a type declaration (an identifier with optional
+ * brackets) which also covers the visibility modifier of constructors; it
+ * does not recognize package visible constructors.
+ *
+ * @return true
if the current position looks like a method
+ * declaration header.
+ */
+ private boolean looksLikeMethodDecl() {
+ /*
+ * TODO This heuristic does not recognize package private constructors
+ * since those do have neither type nor visibility keywords.
+ * One option would be to go over the parameter list, but that might
+ * be empty as well, or not typed in yet - hard to do without an AST...
+ */
+
+ nextToken();
+ if (fToken == Symbols.TokenIDENT) { // method name
+ do nextToken();
+ while (skipBrackets()); // optional brackets for array valued return types
+
+ return fToken == Symbols.TokenIDENT; // return type name
+
+ }
+ return false;
+ }
+
+ /**
+ * Returns true
if the current tokens look like an anonymous type declaration
+ * header (i.e. a type name (potentially qualified) and a new keyword). The heuristic calls
+ * nextToken
and expects a possibly qualified identifier (type name) and a new
+ * keyword
+ *
+ * @return true
if the current position looks like a anonymous type declaration
+ * header.
+ */
+ private boolean looksLikeAnonymousTypeDecl() {
+ nextToken();
+ if (fToken == Symbols.TokenIDENT) { // type name
+ nextToken();
+ while (fToken == Symbols.TokenOTHER) { // dot of qualification
+ nextToken();
+ if (fToken != Symbols.TokenIDENT) // qualificating name
+ return false;
+ nextToken();
+ }
+ return fToken == Symbols.TokenNEW;
+ }
+ return false;
+ }
+
+ /**
+ * Returns true
if the current tokens look like a method
+ * call header (i.e. an identifier as opposed to a keyword taking parenthesized
+ * parameters such as if
).
+ * The heuristic calls
+ * Value is of type
+ * Value is of type
+ * Value is of type
+ * Value is of type
+ * Value is of type nextToken
and expects an identifier
+ * (method name).
+ *
+ * @return true
if the current position looks like a method call
+ * header.
+ */
+ private boolean looksLikeMethodCall() {
+ // TODO add awareness for constructor calls with generic types: new ArrayListfPosition
) is set to the offset of the opening peer if found.
+ *
+ * @param openToken the opening peer token
+ * @param closeToken the closing peer token
+ * @return true
if a matching token was found, false
+ * otherwise
+ */
+ private boolean skipScope(int openToken, int closeToken) {
+
+ int depth= 1;
+
+ while (true) {
+ nextToken();
+
+ if (fToken == closeToken) {
+ depth++;
+ } else if (fToken == openToken) {
+ depth--;
+ if (depth == 0)
+ return true;
+ } else if (fToken == Symbols.TokenEOF) {
+ return false;
+ }
+ }
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java
index 59a0ff351e0..87594c786b4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java
@@ -25,6 +25,8 @@ import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* This scanner is not actually use in the code it was relace by
@@ -90,7 +92,7 @@ public class CPartitionScanner extends RuleBasedPartitionScanner implements ICPa
public CPartitionScanner() {
super();
- IToken comment= new Token(C_MULTILINE_COMMENT);
+ IToken comment= new Token(C_MULTI_LINE_COMMENT);
IToken single_comment= new Token(C_SINGLE_LINE_COMMENT);
IToken string= new Token(C_STRING);
IToken character = new Token(C_CHARACTER);
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
index e6c9806bff4..5148df68d1a 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
@@ -44,17 +44,23 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
+import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.ui.CElementContentProvider;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.ILanguageUI;
+import org.eclipse.cdt.ui.text.ICPartitions;
+import org.eclipse.cdt.internal.ui.editor.CDocumentProvider;
import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.internal.ui.editor.CElementHyperlinkDetector;
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
@@ -64,7 +70,6 @@ import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProcessor2;
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
-
/**
* Configuration for an SourceViewer
which shows C code.
*/
@@ -144,7 +149,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
presenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(null));
final IInformationProvider provider = new CElementContentProvider(getEditor());
presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE);
- presenter.setInformationProvider(provider, ICPartitions.C_MULTILINE_COMMENT);
+ presenter.setInformationProvider(provider, ICPartitions.C_MULTI_LINE_COMMENT);
presenter.setInformationProvider(provider, ICPartitions.C_SINGLE_LINE_COMMENT);
presenter.setInformationProvider(provider, ICPartitions.C_STRING);
presenter.setInformationProvider(provider, ICPartitions.C_CHARACTER);
@@ -190,8 +195,8 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
reconciler.setRepairer(dr, ICPartitions.C_SINGLE_LINE_COMMENT);
dr= new DefaultDamagerRepairer(getMultilineCommentScanner());
- reconciler.setDamager(dr, ICPartitions.C_MULTILINE_COMMENT);
- reconciler.setRepairer(dr, ICPartitions.C_MULTILINE_COMMENT);
+ reconciler.setDamager(dr, ICPartitions.C_MULTI_LINE_COMMENT);
+ reconciler.setRepairer(dr, ICPartitions.C_MULTI_LINE_COMMENT);
dr= new DefaultDamagerRepairer(getStringScanner());
reconciler.setDamager(dr, ICPartitions.C_STRING);
@@ -247,10 +252,13 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/
public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- if(ICPartitions.C_MULTILINE_COMMENT.equals(contentType)) {
- return new IAutoEditStrategy[] {new CCommentAutoIndentStrategy()};
- }
- return new IAutoEditStrategy[] {new CAutoIndentStrategy()};
+ String partitioning= getConfiguredDocumentPartitioning(sourceViewer);
+ if (ICPartitions.C_MULTI_LINE_COMMENT.equals(contentType))
+ return new IAutoEditStrategy[] { new CCommentAutoIndentStrategy() };
+// else if (ICPartitions.C_STRING.equals(contentType))
+// return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaStringAutoIndentStrategy(partitioning) };
+ else
+ return new IAutoEditStrategy[] { new CAutoIndentStrategy(partitioning, getProject()) };
}
/**
@@ -303,6 +311,25 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
return (String[]) vector.toArray(new String[vector.size()]);
}
+ private ICProject getProject() {
+ ITextEditor editor= getEditor();
+ if (editor == null)
+ return null;
+
+ ICElement element= null;
+ IEditorInput input= editor.getEditorInput();
+ IDocumentProvider provider= editor.getDocumentProvider();
+ if (provider instanceof CDocumentProvider) {
+ CDocumentProvider cudp= (CDocumentProvider) provider;
+ element= cudp.getWorkingCopy(input);
+ }
+
+ if (element == null)
+ return null;
+
+ return element.getCProject();
+ }
+
/**
* @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
*/
@@ -370,7 +397,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] {
IDocument.DEFAULT_CONTENT_TYPE,
- ICPartitions.C_MULTILINE_COMMENT,
+ ICPartitions.C_MULTI_LINE_COMMENT,
ICPartitions.C_SINGLE_LINE_COMMENT,
ICPartitions.C_STRING,
ICPartitions.C_CHARACTER};
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java
index 81b4dcdc46f..56d432e64dd 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java
@@ -11,11 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text;
-import org.eclipse.cdt.internal.ui.text.util.CColorManager;
-import org.eclipse.cdt.ui.CUIPlugin;
-
import org.eclipse.core.runtime.Preferences;
-
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
@@ -26,6 +22,11 @@ import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
+import org.eclipse.cdt.internal.ui.text.util.CColorManager;
+
/**
* This type shares all scanners and the color manager between
@@ -178,7 +179,7 @@ public class CTextTools {
public IDocumentPartitioner createDocumentPartitioner() {
String[] types= new String[] {
- ICPartitions.C_MULTILINE_COMMENT,
+ ICPartitions.C_MULTI_LINE_COMMENT,
ICPartitions.C_SINGLE_LINE_COMMENT,
ICPartitions.C_STRING,
ICPartitions.C_CHARACTER
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java
index 7dc69f9d420..386ebb8acf4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java
@@ -18,6 +18,8 @@ import org.eclipse.jface.text.rules.IPartitionTokenScanner;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
+import org.eclipse.cdt.ui.text.ICPartitions;
+
/**
* This scanner recognizes the C multi line comments, C single line comments,
@@ -59,7 +61,7 @@ public class FastCPartitionScanner implements IPartitionTokenScanner, ICPartitio
private final IToken[] fTokens= new IToken[] {
new Token(null),
new Token(C_SINGLE_LINE_COMMENT),
- new Token(C_MULTILINE_COMMENT),
+ new Token(C_MULTI_LINE_COMMENT),
new Token(C_CHARACTER),
new Token(C_STRING)
};
@@ -340,7 +342,7 @@ public class FastCPartitionScanner implements IPartitionTokenScanner, ICPartitio
else if (contentType.equals(C_SINGLE_LINE_COMMENT))
return SINGLE_LINE_COMMENT;
- else if (contentType.equals(C_MULTILINE_COMMENT))
+ else if (contentType.equals(C_MULTI_LINE_COMMENT))
return MULTI_LINE_COMMENT;
else if (contentType.equals(C_STRING))
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java
new file mode 100644
index 00000000000..87c218b7bc9
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.IDocumentPartitioningListener;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Position;
+
+/**
+ * Minimal implementation of IDocument to apply text edit onto a string.
+ */
+public class SimpleDocument implements IDocument {
+
+ private StringBuffer buffer;
+
+ public SimpleDocument(String source) {
+ buffer = new StringBuffer(source);
+ }
+
+ public SimpleDocument(char[] source) {
+ buffer = new StringBuffer(source.length);
+ buffer.append(source);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getChar(int)
+ */
+ public char getChar(int offset) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLength()
+ */
+ public int getLength() {
+ return this.buffer.length();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#get()
+ */
+ public String get() {
+ return this.buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#get(int, int)
+ */
+ public String get(int offset, int length) {
+ return this.buffer.substring(offset, offset + length);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
+ */
+ public void set(String text) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
+ */
+ public void replace(int offset, int length, String text) {
+
+ this.buffer.replace(offset, offset + length, text);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void addDocumentListener(IDocumentListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void removeDocumentListener(IDocumentListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
+ */
+ public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
+ */
+ public void addPositionCategory(String category) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
+ */
+ public void removePositionCategory(String category) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPositionCategories()
+ */
+ public String[] getPositionCategories() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
+ */
+ public boolean containsPositionCategory(String category) {
+ // defining interface method
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
+ */
+ public void addPosition(Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
+ */
+ public void removePosition(Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
+ */
+ public void addPosition(String category, Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
+ */
+ public void removePosition(String category, Position position) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
+ */
+ public Position[] getPositions(String category) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String, int, int)
+ */
+ public boolean containsPosition(String category, int offset, int length) {
+ // defining interface method
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String, int)
+ */
+ public int computeIndexInCategory(String category, int offset) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
+ */
+ public void addPositionUpdater(IPositionUpdater updater) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
+ */
+ public void removePositionUpdater(IPositionUpdater updater) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater, int)
+ */
+ public void insertPositionUpdater(IPositionUpdater updater, int index) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
+ */
+ public IPositionUpdater[] getPositionUpdaters() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLegalContentTypes()
+ */
+ public String[] getLegalContentTypes() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getContentType(int)
+ */
+ public String getContentType(int offset) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getPartition(int)
+ */
+ public ITypedRegion getPartition(int offset) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int)
+ */
+ public ITypedRegion[] computePartitioning(int offset, int length) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
+ */
+ public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
+ */
+ public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)
+ */
+ public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
+ // defining interface method
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner()
+ */
+ public IDocumentPartitioner getDocumentPartitioner() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineLength(int)
+ */
+ public int getLineLength(int line) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
+ */
+ public int getLineOfOffset(int offset) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
+ */
+ public int getLineOffset(int line) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
+ */
+ public IRegion getLineInformation(int line) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
+ */
+ public IRegion getLineInformationOfOffset(int offset) {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
+ */
+ public int getNumberOfLines() {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int)
+ */
+ public int getNumberOfLines(int offset, int length) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String)
+ */
+ public int computeNumberOfLines(String text) {
+ // defining interface method
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters()
+ */
+ public String[] getLegalLineDelimiters() {
+ // defining interface method
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
+ */
+ public String getLineDelimiter(int line) {
+ // defining interface method
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.jface.text.IDocument#search(int, java.lang.String, boolean, boolean, boolean)
+ * @deprecated
+ */
+ public int search(
+ int startOffset,
+ String findString,
+ boolean forwardSearch,
+ boolean caseSensitive,
+ boolean wholeWord) {
+ // defining interface method
+ return 0;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java
new file mode 100644
index 00000000000..68c823fa8cf
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/Symbols.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.text;
+
+/**
+ * Symbols for the heuristic C/C++ scanner.
+ */
+public interface Symbols {
+ int TokenEOF= -1;
+ int TokenLBRACE= 1;
+ int TokenRBRACE= 2;
+ int TokenLBRACKET= 3;
+ int TokenRBRACKET= 4;
+ int TokenLPAREN= 5;
+ int TokenRPAREN= 6;
+ int TokenSEMICOLON= 7;
+ int TokenOTHER= 8;
+ int TokenCOLON= 9;
+ int TokenQUESTIONMARK= 10;
+ int TokenCOMMA= 11;
+ int TokenEQUAL= 12;
+ int TokenLESSTHAN= 13;
+ int TokenGREATERTHAN= 14;
+ int TokenIF= 109;
+ int TokenDO= 1010;
+ int TokenFOR= 1011;
+ int TokenTRY= 1012;
+ int TokenCASE= 1013;
+ int TokenELSE= 1014;
+ int TokenBREAK= 1015;
+ int TokenCATCH= 1016;
+ int TokenWHILE= 1017;
+ int TokenRETURN= 1018;
+ int TokenSTATIC= 1019;
+ int TokenSWITCH= 1020;
+// int TokenFINALLY= 1021;
+// int TokenSYNCHRONIZED= 1022;
+ int TokenGOTO= 1023;
+ int TokenDEFAULT= 1024;
+ int TokenNEW= 1025;
+ int TokenCLASS= 1026;
+// int TokenINTERFACE= 1027;
+ int TokenENUM= 1028;
+ int TokenIDENT= 2000;
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java
index 35d2fd1ec4e..460cd545453 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java
@@ -160,6 +160,51 @@ public class PreferenceConstants {
*/
public static final String EDITOR_TEXT_HOVER_MODIFIER_MASKS= "hoverModifierMasks"; //$NON-NLS-1$
+ /**
+ * A named preference that controls whether the 'close strings' feature
+ * is enabled.
+ * Boolean
.
+ * Boolean
.
+ * Boolean
.
+ * Boolean
.
+ * Boolean
.
+ * javaEditorTextHovers
.
@@ -412,6 +457,10 @@ public class PreferenceConstants {
store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false);
store.setDefault(PreferenceConstants.EDITOR_FOLDING_MACROS, true);
-
+ store.setDefault(PreferenceConstants.EDITOR_CLOSE_STRINGS, true);
+ store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACKETS, true);
+ store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACES, true);
+ store.setDefault(PreferenceConstants.EDITOR_WRAP_STRINGS, true);
+ store.setDefault(PreferenceConstants.EDITOR_ESCAPE_STRINGS, false);
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICPartitions.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICPartitions.java
similarity index 51%
rename from core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICPartitions.java
rename to core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICPartitions.java
index c437b0c1e1f..77278139f57 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICPartitions.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICPartitions.java
@@ -1,49 +1,42 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX Software Systems - Initial API and implementation
- * IBM Corporation
+ * IBM Corporation - initial API and implementation
*******************************************************************************/
-
-package org.eclipse.cdt.internal.ui.text;
+package org.eclipse.cdt.ui.text;
/**
- *
- * The name of the C partitioning.
- * @since 3.0
+ * Definition of C partitioning and its partitions.
*/
public interface ICPartitions {
- String SKIP= "__skip"; //$NON-NLS-1$
- /**
- * The identifier multi-line (JLS2: TraditionalComment) comment partition content type.
- */
- String C_MULTILINE_COMMENT= "c_multi_line_comment"; //$NON-NLS-1$
-
- /**
- * The identifier of the single-line (JLS2: EndOfLineComment) end comment partition content type.
- */
- String C_SINGLE_LINE_COMMENT= "c_single_line_comment"; //$NON-NLS-1$
-
- /**
- * The identifier of the C string partition content type.
- */
- String C_STRING= "c_string"; //$NON-NLS-1$
-
- /**
- * The identifier of the C character partition content type.
- */
- String C_CHARACTER= "c_character"; //$NON-NLS-1$
-
/**
* The identifier of the C partitioning.
*/
String C_PARTITIONING= "___c_partitioning"; //$NON-NLS-1$
+ /**
+ * The identifier of the single-line end comment partition content type.
+ */
+ String C_SINGLE_LINE_COMMENT= "__c_singleline_comment"; //$NON-NLS-1$
+ /**
+ * The identifier multi-line comment partition content type.
+ */
+ String C_MULTI_LINE_COMMENT= "__c_multiline_comment"; //$NON-NLS-1$
+
+ /**
+ * The identifier of the C string partition content type.
+ */
+ String C_STRING= "__c_string"; //$NON-NLS-1$
+
+ /**
+ * The identifier of the C character partition content type.
+ */
+ String C_CHARACTER= "__c_character"; //$NON-NLS-1$
}