Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions org.eclipse.jdt.ui/preview/formatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ public class Empty {}
{
@SuppressWarnings("unused") final @Positive int k;
}
String s = "123" + """
abcdef""" + "789";
void foo() { ;; }
void empty(@SuppressWarnings("unused") final int i) { }}
enum MyEnum { @Deprecated UNDEFINED(0) { }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ private FormatterMessages() {
public static String FormatterModifyDialog_newLines_pref_before_finally_statements;
public static String FormatterModifyDialog_newLines_pref_before_while_in_do_statements;
public static String FormatterModifyDialog_newLines_pref_empty_statement;
public static String FormatterModifyDialog_newLines_pref_textblock_statement;
public static String FormatterModifyDialog_newLines_pref_end_of_file;
public static String FormatterModifyDialog_newLines_pref_enum_constants;
public static String FormatterModifyDialog_newLines_pref_fields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ FormatterModifyDialog_newLines_pref_keep_type_declaration_on_one_line=Class decl
FormatterModifyDialog_newLines_pref_end_of_file=At end of file
FormatterModifyDialog_newLines_pref_after_labels=After labels
FormatterModifyDialog_newLines_pref_empty_statement=Before empty statement
FormatterModifyDialog_newLines_pref_textblock_statement=After and before opening and closing quotes of text block

FormatterModifyDialog_newLines_pref_after_opening_brace_of_array_initializer=After opening brace of array initializer
FormatterModifyDialog_newLines_pref_before_closing_brace_of_array_initializer=Before closing brace of array initializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,7 @@ private void createNewLinesTree() {
Consumer<Section> modAll= s -> CheckboxPreference.addModifyAll(s, fImages);
fTree.builder(FormatterMessages.FormatterModifyDialog_newLines_tree_new_lines, "section-newlines") //$NON-NLS-1$
.pref(FormatterMessages.FormatterModifyDialog_newLines_pref_empty_statement, DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE)
.pref(FormatterMessages.FormatterModifyDialog_newLines_pref_textblock_statement, DefaultCodeFormatterConstants.FORMATTER_PUT_TEXT_BLOCK_QUOTES_ON_NEW_LINE)
.gap()
.pref(FormatterMessages.FormatterModifyDialog_newLines_pref_after_opening_brace_of_array_initializer,
DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER)
Expand Down Expand Up @@ -1374,7 +1375,7 @@ private void createNewLinesTree() {
.build(null, (parent, label, key) -> {
String[] values= CheckboxPreference.DO_NOT_INSERT_INSERT;
if (parent.getKey().endsWith("-ifelse") || parent.getKey().endsWith("-simpleloops") //$NON-NLS-1$ //$NON-NLS-2$
|| DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE.equals(key)) {
|| DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE.equals(key) || DefaultCodeFormatterConstants.FORMATTER_PUT_TEXT_BLOCK_QUOTES_ON_NEW_LINE.equals(key) ) {
values= CheckboxPreference.FALSE_TRUE;
}
return fTree.addCheckbox(parent, label, key, values);
Expand Down
Loading