Skip to content

Commit 87068e0

Browse files
committed
fix constructor pretty printing; <init> -> Name
1 parent 8bb41e6 commit 87068e0

File tree

79 files changed

+146
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+146
-135
lines changed

lsif-semanticdb/src/main/java/com/sourcegraph/lsif_semanticdb/SignatureFormatter.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,16 @@ private void formatMethodSignature(MethodSignature methodSignature) {
105105
.collect(Collectors.joining(", ", "<", ">")));
106106
}
107107

108-
printKeyword(formatType(methodSignature.getReturnType()));
109-
s.append(symbolInformation.getDisplayName());
108+
if (symbolInformation.getKind() != SymbolInformation.Kind.CONSTRUCTOR) {
109+
printKeyword(formatType(methodSignature.getReturnType()));
110+
s.append(symbolInformation.getDisplayName());
111+
} else {
112+
s.append(
113+
SymbolDescriptor.parseFromSymbol(
114+
SymbolDescriptor.parseFromSymbol(symbolInformation.getSymbol()).owner)
115+
.descriptor
116+
.name);
117+
}
110118

111119
s.append(
112120
methodSignature.getParameterListsList().stream()

semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ private void emitSymbolInformation(Symbol sym, JCTree tree) {
108108
case METHOD:
109109
builder.setKind(Kind.METHOD);
110110
break;
111+
case CONSTRUCTOR:
112+
builder.setKind(Kind.CONSTRUCTOR);
113+
break;
111114
case TYPE_PARAMETER:
112115
builder.setKind(Kind.TYPE_PARAMETER);
113116
break;

tests/snapshots/src/main/generated/com/airbnb/epoxy/AsyncEpoxyController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public abstract class AsyncEpoxyController extends EpoxyController {
3030
* A new instance that does model building and diffing asynchronously.
3131
*/
3232
public AsyncEpoxyController() {
33-
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyController#`<init>`(). public void <init>()
33+
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyController#`<init>`(). public AsyncEpoxyController()
3434
this(true);
3535
// ^^^^ reference com/airbnb/epoxy/AsyncEpoxyController#`<init>`(+1).
3636
}
@@ -40,7 +40,7 @@ public AsyncEpoxyController() {
4040
* both on the main thread.
4141
*/
4242
public AsyncEpoxyController(boolean enableAsync) {
43-
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyController#`<init>`(+1). public void <init>(boolean enableAsync)
43+
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyController#`<init>`(+1). public AsyncEpoxyController(boolean enableAsync)
4444
// ^^^^^^^^^^^ definition local0 boolean enableAsync
4545
this(enableAsync, enableAsync);
4646
// ^^^^ reference com/airbnb/epoxy/AsyncEpoxyController#`<init>`(+2).
@@ -52,7 +52,7 @@ public AsyncEpoxyController(boolean enableAsync) {
5252
* Individually control whether model building and diffing are done async or on the main thread.
5353
*/
5454
public AsyncEpoxyController(boolean enableAsyncModelBuilding, boolean enableAsyncDiffing) {
55-
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyController#`<init>`(+2). public void <init>(boolean enableAsyncModelBuilding, boolean enableAsyncDiffing)
55+
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyController#`<init>`(+2). public AsyncEpoxyController(boolean enableAsyncModelBuilding, boolean enableAsyncDiffing)
5656
// ^^^^^^^^^^^^^^^^^^^^^^^^ definition local1 boolean enableAsyncModelBuilding
5757
// ^^^^^^^^^^^^^^^^^^ definition local2 boolean enableAsyncDiffing
5858
super(getHandler(enableAsyncModelBuilding), getHandler(enableAsyncDiffing));

tests/snapshots/src/main/generated/com/airbnb/epoxy/AsyncEpoxyDiffer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ interface ResultCallback {
7878
// ^^^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#
7979

8080
AsyncEpoxyDiffer(
81-
//^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#`<init>`(). void <init>(unresolved_type handler, ResultCallback resultCallback, unresolved_type diffCallback)
81+
//^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#`<init>`(). AsyncEpoxyDiffer(unresolved_type handler, ResultCallback resultCallback, unresolved_type diffCallback)
8282
@NonNull Handler handler,
8383
// ^^^^^^^ reference androidx/annotation/NonNull#
8484
// ^^^^^^^ reference _root_/
@@ -448,7 +448,7 @@ private synchronized boolean tryLatchList(@Nullable List<? extends EpoxyModel<?>
448448
*/
449449
private static class GenerationTracker {
450450
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker# private static class GenerationTracker
451-
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#`<init>`(). private void <init>()
451+
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#`<init>`(). private GenerationTracker()
452452

453453
// Max generation of currently scheduled runnable
454454
private volatile int maxScheduledGeneration;
@@ -523,7 +523,7 @@ private static class DiffCallback extends DiffUtil.Callback {
523523
// ^^^^^^^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#DiffCallback#diffCallback. private final unresolved_type diffCallback
524524

525525
DiffCallback(List<? extends EpoxyModel<?>> oldList, List<? extends EpoxyModel<?>> newList,
526-
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#DiffCallback#`<init>`(). void <init>(List<? extends EpoxyModel<?>> oldList, List<? extends EpoxyModel<?>> newList, unresolved_type diffCallback)
526+
// ^^^^^^ definition com/airbnb/epoxy/AsyncEpoxyDiffer#DiffCallback#`<init>`(). DiffCallback(List<? extends EpoxyModel<?>> oldList, List<? extends EpoxyModel<?>> newList, unresolved_type diffCallback)
527527
// ^^^^ reference java/util/List#
528528
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
529529
// ^^^^^^^ definition local28 List<? extends EpoxyModel<?>> oldList

tests/snapshots/src/main/generated/com/airbnb/epoxy/BaseEpoxyAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public int getSpanSize(int position) {
135135
};
136136

137137
public BaseEpoxyAdapter() {
138-
// ^^^^^^ definition com/airbnb/epoxy/BaseEpoxyAdapter#`<init>`(). public void <init>()
138+
// ^^^^^^ definition com/airbnb/epoxy/BaseEpoxyAdapter#`<init>`(). public BaseEpoxyAdapter()
139139
// Defaults to stable ids since view models generate unique ids. Set this to false in the
140140
// subclass if you don't want to support it
141141
setHasStableIds(true);

tests/snapshots/src/main/generated/com/airbnb/epoxy/BoundViewHolders.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//^^^^^^^^^^^^^^^ reference java/lang/SuppressWarnings#
2525
public class BoundViewHolders implements Iterable<EpoxyViewHolder> {
2626
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BoundViewHolders# public class BoundViewHolders extends Iterable<EpoxyViewHolder>
27-
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BoundViewHolders#`<init>`(). public void <init>()
27+
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BoundViewHolders#`<init>`(). public BoundViewHolders()
2828
// ^^^^^^^^ reference java/lang/Iterable#
2929
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyViewHolder#
3030
private final LongSparseArray<EpoxyViewHolder> holders = new LongSparseArray<>();
@@ -105,7 +105,7 @@ public EpoxyViewHolder getHolderForModel(EpoxyModel<?> model) {
105105

106106
private class HolderIterator implements Iterator<EpoxyViewHolder> {
107107
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BoundViewHolders#HolderIterator# private class HolderIterator extends Iterator<EpoxyViewHolder>
108-
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BoundViewHolders#HolderIterator#`<init>`(). private void <init>()
108+
// ^^^^^^^^^^^^^^ definition com/airbnb/epoxy/BoundViewHolders#HolderIterator#`<init>`(). private HolderIterator()
109109
// ^^^^^^^^ reference java/util/Iterator#
110110
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyViewHolder#
111111
private int position = 0;

tests/snapshots/src/main/generated/com/airbnb/epoxy/Carousel.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ public SnapHelper buildSnapHelper(Context context) {
150150
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#numViewsToShowOnScreen. private float numViewsToShowOnScreen
151151

152152
public Carousel(Context context) {
153-
// ^^^^^^ definition com/airbnb/epoxy/Carousel#`<init>`(). public void <init>(unresolved_type context)
153+
// ^^^^^^ definition com/airbnb/epoxy/Carousel#`<init>`(). public Carousel(unresolved_type context)
154154
// ^^^^^^^ reference _root_/
155155
// ^^^^^^^ definition local4 unresolved_type context
156156
super(context);
157157
// ^^^^^^^ reference local4
158158
}
159159

160160
public Carousel(Context context, @Nullable AttributeSet attrs) {
161-
// ^^^^^^ definition com/airbnb/epoxy/Carousel#`<init>`(+1). public void <init>(unresolved_type context, unresolved_type attrs)
161+
// ^^^^^^ definition com/airbnb/epoxy/Carousel#`<init>`(+1). public Carousel(unresolved_type context, unresolved_type attrs)
162162
// ^^^^^^^ reference _root_/
163163
// ^^^^^^^ definition local5 unresolved_type context
164164
// ^^^^^^^^ reference androidx/annotation/Nullable#
@@ -170,7 +170,7 @@ public Carousel(Context context, @Nullable AttributeSet attrs) {
170170
}
171171

172172
public Carousel(Context context, @Nullable AttributeSet attrs, int defStyle) {
173-
// ^^^^^^ definition com/airbnb/epoxy/Carousel#`<init>`(+2). public void <init>(unresolved_type context, unresolved_type attrs, int defStyle)
173+
// ^^^^^^ definition com/airbnb/epoxy/Carousel#`<init>`(+2). public Carousel(unresolved_type context, unresolved_type attrs, int defStyle)
174174
// ^^^^^^^ reference _root_/
175175
// ^^^^^^^ definition local7 unresolved_type context
176176
// ^^^^^^^^ reference androidx/annotation/Nullable#
@@ -784,7 +784,7 @@ public static class Padding {
784784

785785
enum PaddingType {
786786
// ^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#PaddingType# enum PaddingType
787-
// ^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#PaddingType#`<init>`(). private void <init>()
787+
// ^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#PaddingType#`<init>`(). private PaddingType()
788788
PX,
789789
// ^^ definition com/airbnb/epoxy/Carousel#Padding#PaddingType#PX. PaddingType.PX /* ordinal 0 */
790790
DP,
@@ -948,7 +948,7 @@ public static Padding dp(
948948
* via an item decoration.
949949
*/
950950
public Padding(@Px int paddingPx, @Px int itemSpacingPx) {
951-
// ^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#`<init>`(). public void <init>(int paddingPx, int itemSpacingPx)
951+
// ^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#`<init>`(). public Padding(int paddingPx, int itemSpacingPx)
952952
// ^^ reference androidx/annotation/Px#
953953
// ^^^^^^^^^ definition local52 int paddingPx
954954
// ^^ reference androidx/annotation/Px#
@@ -973,7 +973,7 @@ public Padding(@Px int paddingPx, @Px int itemSpacingPx) {
973973
* via an item decoration.
974974
*/
975975
public Padding(
976-
// ^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#`<init>`(+1). public void <init>(int leftPx, int topPx, int rightPx, int bottomPx, int itemSpacingPx)
976+
// ^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#`<init>`(+1). public Padding(int leftPx, int topPx, int rightPx, int bottomPx, int itemSpacingPx)
977977
@Px int leftPx, @Px int topPx, @Px int rightPx, @Px int bottomPx, @Px int itemSpacingPx) {
978978
// ^^ reference androidx/annotation/Px#
979979
// ^^^^^^ definition local54 int leftPx
@@ -1006,7 +1006,7 @@ public Padding(
10061006
* @param paddingType Unit / Type of the given paddings/ itemspacing.
10071007
*/
10081008
private Padding(
1009-
// ^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#`<init>`(+2). private void <init>(int left, int top, int right, int bottom, int itemSpacing, PaddingType paddingType)
1009+
// ^^^^^^ definition com/airbnb/epoxy/Carousel#Padding#`<init>`(+2). private Padding(int left, int top, int right, int bottom, int itemSpacing, PaddingType paddingType)
10101010
int left, int top, int right, int bottom, int itemSpacing, PaddingType paddingType) {
10111011
// ^^^^ definition local59 int left
10121012
// ^^^ definition local60 int top
@@ -1151,7 +1151,7 @@ public void clear() {
11511151
/** Provide a SnapHelper implementation you want to use with a Carousel. */
11521152
public abstract static class SnapHelperFactory {
11531153
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#SnapHelperFactory# public abstract static class SnapHelperFactory
1154-
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#SnapHelperFactory#`<init>`(). public void <init>()
1154+
// ^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/Carousel#SnapHelperFactory#`<init>`(). public SnapHelperFactory()
11551155
/**
11561156
* Create and return a new instance of a {@link androidx.recyclerview.widget.SnapHelper} for use
11571157
* with a Carousel.

tests/snapshots/src/main/generated/com/airbnb/epoxy/ControllerHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
public abstract class ControllerHelper<T extends EpoxyController> {
1414
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelper# public abstract class ControllerHelper<T extends EpoxyController>
15-
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelper#`<init>`(). public void <init>()
15+
// ^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelper#`<init>`(). public ControllerHelper()
1616
// ^ definition com/airbnb/epoxy/ControllerHelper#[T] T extends EpoxyController
1717
// ^^^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyController#
1818
public abstract void resetAutoModels();

tests/snapshots/src/main/generated/com/airbnb/epoxy/ControllerHelperLookup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class ControllerHelperLookup {
3333
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelperLookup# class ControllerHelperLookup
34-
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelperLookup#`<init>`(). void <init>()
34+
// ^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelperLookup#`<init>`(). ControllerHelperLookup()
3535
private static final String GENERATED_HELPER_CLASS_SUFFIX = "_EpoxyHelper";
3636
// ^^^^^^ reference java/lang/String#
3737
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition com/airbnb/epoxy/ControllerHelperLookup#GENERATED_HELPER_CLASS_SUFFIX. private static final String GENERATED_HELPER_CLASS_SUFFIX

tests/snapshots/src/main/generated/com/airbnb/epoxy/ControllerModelList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void onItemRangeRemoved(int positionStart, int itemCount) {
4343
};
4444

4545
ControllerModelList(int expectedModelCount) {
46-
//^^^^^^ definition com/airbnb/epoxy/ControllerModelList#`<init>`(). void <init>(int expectedModelCount)
46+
//^^^^^^ definition com/airbnb/epoxy/ControllerModelList#`<init>`(). ControllerModelList(int expectedModelCount)
4747
// ^^^^^^^^^^^^^^^^^^ definition local8 int expectedModelCount
4848
super(expectedModelCount);
4949
// ^^^^^ reference com/airbnb/epoxy/ModelList#`<init>`().

0 commit comments

Comments
 (0)