diff --git a/semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java b/semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java index 901950ae..6c5664dd 100644 --- a/semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java +++ b/semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java @@ -126,6 +126,17 @@ public Void visitMethod(MethodTree node, Void unused) { range = CompilerRange.FROM_TEXT_SEARCH; } emitSymbolOccurrence(meth.sym, meth, Role.DEFINITION, range); + + List 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); } diff --git a/tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyTouchHelper.java b/tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyTouchHelper.java index 89efbb7b..ea30c3d1 100644 --- a/tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyTouchHelper.java +++ b/tests/snapshots/src/main/generated/com/airbnb/epoxy/EpoxyTouchHelper.java @@ -247,6 +247,7 @@ private DragBuilder3(EpoxyController controller, RecyclerView recyclerView, int * draggable type. */ public DragBuilder4 withTarget(Class 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] @@ -737,6 +738,7 @@ private SwipeBuilder2(RecyclerView recyclerView, * swipable type. */ public SwipeBuilder3 withTarget(Class 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] diff --git a/tests/snapshots/src/main/generated/minimized/InnerClasses.java b/tests/snapshots/src/main/generated/minimized/InnerClasses.java index 21275f3f..114172a6 100644 --- a/tests/snapshots/src/main/generated/minimized/InnerClasses.java +++ b/tests/snapshots/src/main/generated/minimized/InnerClasses.java @@ -85,6 +85,8 @@ public Integer apply(Integer integer) { } private static B runInnerInterface(InnerInterface 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# diff --git a/tests/snapshots/src/main/generated/minimized/TypeVariables.java b/tests/snapshots/src/main/generated/minimized/TypeVariables.java index 61fb3c1d..4aae5ddc 100644 --- a/tests/snapshots/src/main/generated/minimized/TypeVariables.java +++ b/tests/snapshots/src/main/generated/minimized/TypeVariables.java @@ -33,6 +33,7 @@ public void mI() {} } public static void app(T t) { +// ^ definition minimized/TypeVariables#app().[T] // ^ reference minimized/TypeVariables#C# // ^ reference minimized/TypeVariables#I# // ^^^ definition minimized/TypeVariables#app().