Fixed IDEA-175161 Javadoc formatter joins lines incorrectly

Never merge a leading asterisk to the previous line.
This commit is contained in:
Rustam Vishnyakov
2018-05-29 15:55:21 +03:00
parent 31499fbdc5
commit 6fd644de45
2 changed files with 8 additions and 7 deletions
@@ -1193,6 +1193,9 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
else if (myRole1 == ChildRole.OPERATION_SIGN) {
createSpaceInCode(mySettings.SPACE_AROUND_UNARY_OPERATOR);
}
else if (myType2 == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS) {
createSpaceProperty(false, true, 0);
}
else if ((myType1 == JavaDocTokenType.DOC_TAG_VALUE_TOKEN || myType1 == JavaDocElementType.DOC_TAG_VALUE_ELEMENT) &&
(myType2 == JavaDocTokenType.DOC_TAG_VALUE_TOKEN || myType2 == JavaDocElementType.DOC_TAG_VALUE_ELEMENT)) {
createSpaceInCode(true);
@@ -1185,14 +1185,13 @@ interface Test {
}
fun _testIdea175161() {
fun testIdea175161() {
getSettings().RIGHT_MARGIN = 160;
getSettings().WRAP_COMMENTS = true;
getSettings().KEEP_LINE_BREAKS = false;
doTextTest(
"""
package com.company;
"""package com.company;
public class Test {
@@ -1206,14 +1205,13 @@ public class Test {
}
""",
"""
package com.company;
"""package com.company;
public class Test {
/**
* Shortcut method for EntryDto items. This method will fetch the id from {@code item} and pass it to {@link #test2(Object, Object, Object, Object, Object)}.
* Make sure the dto item returns a non-null id.
* Shortcut method for EntryDto items. This method will fetch the id from {@code item} and pass it to {@link #test2(Object, Object, Object, Object,
* Object)}. Make sure the dto item returns a non-null id.
*/
public void test() {
}