Skip to content

Commit

Permalink
Bug 196547 - [formatter] Option to join or rewrap wrapped line commen…
Browse files Browse the repository at this point in the history
…ts (#1037)
  • Loading branch information
mateusz-matela committed Jan 2, 2024
1 parent 388871f commit 7c90373
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private FormatterMessages() {
public static String FormatterModifyDialog_comments_pref_line_width_count_from_starting_position;
public static String FormatterModifyDialog_comments_pref_never_indent_block_comments_on_first_column;
public static String FormatterModifyDialog_comments_pref_never_indent_line_comments_on_first_column;
public static String FormatterModifyDialog_comments_pref_never_join_line_comments;
public static String FormatterModifyDialog_comments_pref_never_join_lines;
public static String FormatterModifyDialog_comments_pref_new_line_after_param_tags;
public static String FormatterModifyDialog_comments_pref_new_lines_at_comment_boundaries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ FormatterModifyDialog_comments_pref_new_lines_at_comment_boundaries=/* and */ on
FormatterModifyDialog_comments_pref_new_lines_at_javadoc_boundaries=/** and */ on separate lines
FormatterModifyDialog_comments_pref_never_indent_block_comments_on_first_column=Never indent block comments on first column
FormatterModifyDialog_comments_pref_never_indent_line_comments_on_first_column=Never indent line comments on first column
FormatterModifyDialog_comments_pref_never_join_lines=Never join lines
FormatterModifyDialog_comments_pref_never_join_line_comments=Never join consecutive line comments
FormatterModifyDialog_comments_pref_never_join_lines=Never join lines in javadoc/block comments

FormatterModifyDialog_indentation_pref_tab_policy=Tab policy:
FormatterModifyDialog_indentation_tab_policy_SPACE=Spaces only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,9 @@ private void createCommentsTree() {
CheckboxPreference child= fTree.addCheckbox(pref, FormatterMessages.FormatterModifyDialog_comments_pref_format_line_comments_on_first_column,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, CheckboxPreference.FALSE_TRUE);
pref.addDependant(child, valueAcceptor(DefaultCodeFormatterConstants.TRUE));
child= fTree.addCheckbox(pref, FormatterMessages.FormatterModifyDialog_comments_pref_never_join_line_comments,
DefaultCodeFormatterConstants.FORMATTER_JOIN_LINE_COMMENTS, CheckboxPreference.TRUE_FALSE);
pref.addDependant(child, valueAcceptor(DefaultCodeFormatterConstants.TRUE));
})
.pref(FormatterMessages.FormatterModifyDialog_comments_pref_format_header, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER)
.gap()
Expand Down Expand Up @@ -1632,6 +1635,10 @@ private void createCommentsTree() {
blockMaster.addDependant(pref, blockChecker);
headerMaster.addDependant(pref, blockChecker);
}

Preference<?> joinLinesPref= section.findChildPreference(DefaultCodeFormatterConstants.FORMATTER_JOIN_LINES_IN_COMMENTS);
javadocMaster.addDependant(joinLinesPref, javadocChecker.or(blockChecker));
blockMaster.addDependant(joinLinesPref, javadocChecker.or(blockChecker));
}

private SimpleTreeBuilder<?> createJavadocAlignOptions() {
Expand Down

0 comments on commit 7c90373

Please sign in to comment.