From 62617729fa0ff394f8493338c93eca98f04f438f Mon Sep 17 00:00:00 2001 From: Marco Stornelli Date: Mon, 22 Apr 2019 09:27:01 +0200 Subject: [PATCH] Bug 239878 - Added new line before identifier to the UI The option was already used but there wasn't any widget in the UI to let user change it. Change-Id: Ib8795468cc83b89bb3ef9676a5e0ed3f288d55da Signed-off-by: Marco Stornelli --- .../internal/ui/preferences/formatter/FormatterMessages.java | 1 + .../ui/preferences/formatter/FormatterMessages.properties | 1 + .../internal/ui/preferences/formatter/NewLinesTabPage.java | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java index b32d4935651..920f5cad949 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.java @@ -393,6 +393,7 @@ final class FormatterMessages extends NLS { public static String NewLinesTabPage_newlines_group_option_before_colon_in_constructor_initializer_list; public static String NewLinesTabPage_newlines_group_option_after_colon_in_constructor_initializer_list; public static String NewLinesTabPage_newlines_emtpy_statement_on_new_line; + public static String NewLinesTabPage_newlines_before_identifier_in_function_declaration; // public static String NewLinesTabPage_newlines_group_option_empty_class_body; // public static String NewLinesTabPage_newlines_group_option_empty_method_body; // public static String NewLinesTabPage_newlines_group_option_empty_block; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties index 89adf6b4fdb..e51ff78e8ee 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/FormatterMessages.properties @@ -463,6 +463,7 @@ NewLinesTabPage_newlines_group_title=Insert new line NewLinesTabPage_newlines_group_option_before_colon_in_constructor_initializer_list=before colon in constructor initializer list NewLinesTabPage_newlines_group_option_after_colon_in_constructor_initializer_list=after colon in constructor initializer list NewLinesTabPage_newlines_emtpy_statement_on_new_line=before empty statement +NewLinesTabPage_newlines_before_identifier_in_function_declaration=before identifier in function declaration #NewLinesTabPage_newlines_group_option_empty_class_body=in empty &class body #NewLinesTabPage_newlines_group_option_empty_method_body=in empt&y method body #NewLinesTabPage_newlines_group_option_empty_block=in empty &block diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/NewLinesTabPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/NewLinesTabPage.java index 0628080e6ff..31ea645cd9f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/NewLinesTabPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/NewLinesTabPage.java @@ -55,6 +55,10 @@ public class NewLinesTabPage extends FormatterTabPage { DO_NOT_INSERT_INSERT); createPref(newlinesGroup, numColumns, FormatterMessages.NewLinesTabPage_newlines_emtpy_statement_on_new_line, DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, FALSE_TRUE); + createPref(newlinesGroup, numColumns, + FormatterMessages.NewLinesTabPage_newlines_before_identifier_in_function_declaration, + DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_IDENTIFIER_IN_FUNCTION_DECLARATION, + DO_NOT_INSERT_INSERT); // createPref(newlinesGroup, numColumns, FormatterMessages.NewLinesTabPage_newlines_group_option_empty_class_body, DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION, DO_NOT_INSERT_INSERT); // createPref(newlinesGroup, numColumns, FormatterMessages.NewLinesTabPage_newlines_group_option_empty_anonymous_class_body, DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION, DO_NOT_INSERT_INSERT); // createPref(newlinesGroup, numColumns, FormatterMessages.NewLinesTabPage_newlines_group_option_empty_method_body, DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, DO_NOT_INSERT_INSERT);