mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SortContentAction: fix javadoc movement while sorting enum constants
This commit is contained in:
@@ -881,7 +881,9 @@ public class SortContentAction extends PsiElementBaseIntentionAction {
|
||||
|
||||
//PsiEnumConstant holds comments inside, we need codegen to know about this comments to place \n correctly
|
||||
for (SortableEntry entry : sortableList.myEntries) {
|
||||
List<PsiComment> comments = StreamEx.ofTree(entry.myElement, el -> StreamEx.of(el.getChildren())).select(PsiComment.class).toList();
|
||||
List<PsiComment> comments = StreamEx.ofTree(entry.myElement, el -> StreamEx.of(el.getChildren()))
|
||||
.select(PsiComment.class)
|
||||
.filter(comment -> !(comment instanceof PsiDocComment)).toList();
|
||||
for (PsiComment comment : comments) {
|
||||
entry.myBeforeSeparator.add((PsiComment)comment.copy());
|
||||
comment.delete();
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Sort content" "true"
|
||||
|
||||
public enum OSType {
|
||||
/**
|
||||
* one
|
||||
*/
|
||||
ONE,
|
||||
/**
|
||||
* three
|
||||
*/
|
||||
THREE,
|
||||
/**
|
||||
* two
|
||||
*/
|
||||
TWO
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Sort content" "true"
|
||||
|
||||
public enum OSType {
|
||||
/**
|
||||
* one
|
||||
*/
|
||||
ONE,<caret>
|
||||
/**
|
||||
* two
|
||||
*/
|
||||
TWO,
|
||||
/**
|
||||
* three
|
||||
*/
|
||||
THREE
|
||||
}
|
||||
Reference in New Issue
Block a user