Skip to content

Commit

Permalink
Merge pull request #129 from sourcegraph/nsc/method-typeparams
Browse files Browse the repository at this point in the history
add emitting of type parameters in method signatures
  • Loading branch information
Strum355 authored Mar 26, 2021
2 parents 8bf82e4 + 488257b commit 1e4df32
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ public Void visitMethod(MethodTree node, Void unused) {
range = CompilerRange.FROM_TEXT_SEARCH;
}
emitSymbolOccurrence(meth.sym, meth, Role.DEFINITION, range);

List<JCTree.JCTypeParameter> typeParameters = meth.getTypeParameters();
int i = 0;
for (Symbol.TypeVariableSymbol typeSym : meth.sym.getTypeParameters()) {
emitSymbolOccurrence(
typeSym,
typeParameters.get(i),
Role.DEFINITION,
CompilerRange.FROM_POINT_TO_SYMBOL_NAME);
i++;
}
}
return super.visitMethod(node, unused);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ private DragBuilder3(EpoxyController controller, RecyclerView recyclerView, int
* draggable type.
*/
public <U extends EpoxyModel> DragBuilder4<U> withTarget(Class<U> targetModelClass) {
// ^ definition com/airbnb/epoxy/EpoxyTouchHelper#DragBuilder3#withTarget().[U]
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyTouchHelper#DragBuilder4#
// ^ reference com/airbnb/epoxy/EpoxyTouchHelper#DragBuilder3#withTarget().[U]
Expand Down Expand Up @@ -737,6 +738,7 @@ private SwipeBuilder2(RecyclerView recyclerView,
* swipable type.
*/
public <U extends EpoxyModel> SwipeBuilder3<U> withTarget(Class<U> targetModelClass) {
// ^ definition com/airbnb/epoxy/EpoxyTouchHelper#SwipeBuilder2#withTarget().[U]
// ^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyModel#
// ^^^^^^^^^^^^^ reference com/airbnb/epoxy/EpoxyTouchHelper#SwipeBuilder3#
// ^ reference com/airbnb/epoxy/EpoxyTouchHelper#SwipeBuilder2#withTarget().[U]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public Integer apply(Integer integer) {
}

private static <A, B> B runInnerInterface(InnerInterface<A, B> fn, A a) {
// ^ definition minimized/InnerClasses#runInnerInterface().[A]
// ^ definition minimized/InnerClasses#runInnerInterface().[B]
// ^ reference minimized/InnerClasses#runInnerInterface().[B]
// ^^^^^^^^^^^^^^^^^ definition minimized/InnerClasses#runInnerInterface().
// ^^^^^^^^^^^^^^ reference minimized/InnerClasses#InnerInterface#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public void mI() {}
}

public static <T extends C & I> void app(T t) {
// ^ definition minimized/TypeVariables#app().[T]
// ^ reference minimized/TypeVariables#C#
// ^ reference minimized/TypeVariables#I#
// ^^^ definition minimized/TypeVariables#app().
Expand Down

0 comments on commit 1e4df32

Please sign in to comment.