Skip to content

Commit

Permalink
semanticdb-javac: set kind to Variable for local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-guichard committed Jan 10, 2024
1 parent f430a7c commit 79875d1
Show file tree
Hide file tree
Showing 40 changed files with 278 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ private void emitSymbolInformation(Element sym, Tree tree) {
.collect(Collectors.joining(", "));
if (!args.isEmpty())
builder.setDisplayName(sym.getSimpleName().toString() + "(" + args + ")");
break;
case LOCAL_VARIABLE:
builder.setKind(Kind.LOCAL);
break;
}

Semanticdb.SymbolInformation info = builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,14 @@ public synchronized boolean forceListOverride(@Nullable List<EpoxyModel<?>> newL
// display_name interruptedDiff
// signature_documentation java final boolean interruptedDiff
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#forceListOverride().
// kind Variable
// ^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#cancelDiff().
int generation = generationTracker.incrementAndGetNextScheduled();
// ^^^^^^^^^^ definition local 6
// display_name generation
// signature_documentation java int generation
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#forceListOverride().
// kind Variable
// ^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#generationTracker.
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#incrementAndGetNextScheduled().
tryLatchList(newList, generation);
Expand Down Expand Up @@ -309,6 +311,7 @@ public void submitList(@Nullable final List<? extends EpoxyModel<?>> newList) {
// display_name runGeneration
// signature_documentation java final int runGeneration
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#submitList().
// kind Variable
@Nullable final List<? extends EpoxyModel<?>> previousList;
// ^^^^^^^^ reference semanticdb maven maven/androidx.annotation/annotation 1.1.0 androidx/annotation/Nullable#
// ^^^^ reference semanticdb maven jdk 11 java/util/List#
Expand All @@ -317,6 +320,7 @@ public void submitList(@Nullable final List<? extends EpoxyModel<?>> newList) {
// display_name previousList
// signature_documentation java @Nullable\nfinal List<? extends EpoxyModel<?>> previousList
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#submitList().
// kind Variable

synchronized (this) {
// Incrementing generation means any currently-running diffs are discarded when they finish
Expand Down Expand Up @@ -355,6 +359,7 @@ public void submitList(@Nullable final List<? extends EpoxyModel<?>> newList) {
// display_name result
// signature_documentation java DiffResult result
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#submitList().
// kind Variable
if (previousList != null && !previousList.isEmpty()) {
// ^^^^^^^^^^^^ reference local 9
// ^^^^^^^^^^^^ reference local 9
Expand Down Expand Up @@ -393,6 +398,7 @@ public void submitList(@Nullable final List<? extends EpoxyModel<?>> newList) {
// display_name wrappedCallback
// signature_documentation java final DiffCallback wrappedCallback
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#submitList().
// kind Variable
// ^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#DiffCallback#`<init>`().
// ^^^^^^^^^^^^ reference local 9
// ^^^^^^^ reference local 7
Expand All @@ -418,6 +424,7 @@ public void run() {
// display_name result
// signature_documentation java unresolved_type result
// enclosing_symbol local 13
// kind Variable
// ^^^^^^^^ reference semanticdb maven . . DiffUtil#
// ^^^^^^^^^^^^^ reference semanticdb maven . . DiffUtil#calculateDiff#
// ^^^^^^^^^^^^^^^ reference local 11
Expand Down Expand Up @@ -482,6 +489,7 @@ public void run() {
// display_name dispatchResult
// signature_documentation java final boolean dispatchResult
// enclosing_symbol local 19
// kind Variable
// ^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#tryLatchList().
// ^^^^^^^ reference local 16
// ^^^^^^^^^^^^^ reference local 15
Expand Down Expand Up @@ -604,6 +612,7 @@ synchronized boolean finishMaxGeneration() {
// display_name isInterrupting
// signature_documentation java boolean isInterrupting
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#finishMaxGeneration().
// kind Variable
// ^^^^^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#hasUnfinishedGeneration().
maxFinishedGeneration = maxScheduledGeneration;
// ^^^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#maxFinishedGeneration.
Expand Down Expand Up @@ -636,6 +645,7 @@ synchronized boolean finishGeneration(int runGeneration) {
// display_name isLatestGeneration
// signature_documentation java boolean isLatestGeneration
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#finishGeneration().
// kind Variable
maxScheduledGeneration == runGeneration && runGeneration > maxFinishedGeneration;
// ^^^^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/AsyncEpoxyDiffer#GenerationTracker#maxScheduledGeneration.
// ^^^^^^^^^^^^^ reference local 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public EpoxyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// display_name model
// signature_documentation java EpoxyModel<?> model
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#onCreateViewHolder().
// kind Variable
// ^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#viewTypeManager.
// ^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/ViewTypeManager#getModelForViewType().
// ^^^^^^^^ reference local 4
Expand All @@ -279,6 +280,7 @@ public EpoxyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// display_name view
// signature_documentation java unresolved_type view
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#onCreateViewHolder().
// kind Variable
// ^^^^^ reference local 5
// ^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/EpoxyModel#buildView().
// ^^^^^^ reference local 3
Expand Down Expand Up @@ -342,6 +344,7 @@ public void onBindViewHolder(EpoxyViewHolder holder, int position, List<Object>
// display_name modelToShow
// signature_documentation java EpoxyModel<?> modelToShow
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#onBindViewHolder(+1).
// kind Variable
// ^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#getModelForPosition().
// ^^^^^^^^ reference local 10

Expand All @@ -351,6 +354,7 @@ public void onBindViewHolder(EpoxyViewHolder holder, int position, List<Object>
// display_name previouslyBoundModel
// signature_documentation java EpoxyModel<?> previouslyBoundModel
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#onBindViewHolder(+1).
// kind Variable
if (diffPayloadsEnabled()) {
// ^^^^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#diffPayloadsEnabled().
previouslyBoundModel = DiffPayload.getModelFromPayload(payloads, getItemId(position));
Expand Down Expand Up @@ -576,6 +580,7 @@ public void onViewRecycled(EpoxyViewHolder holder) {
// display_name model
// signature_documentation java EpoxyModel<?> model
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#onViewRecycled().
// kind Variable
// ^^^^^^ reference local 26
// ^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/EpoxyViewHolder#getModel().
holder.unbind();
Expand Down Expand Up @@ -728,6 +733,7 @@ public void onSaveInstanceState(Bundle outState) {
// display_name holder
// signature_documentation java EpoxyViewHolder holder
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#onSaveInstanceState().
// kind Variable
// ^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#boundViewHolders.
viewHolderState.save(holder);
// ^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#viewHolderState.
Expand Down Expand Up @@ -813,13 +819,15 @@ protected int getModelPosition(EpoxyModel<?> model) {
// display_name size
// signature_documentation java int size
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#getModelPosition().
// kind Variable
// ^^^^^^^^^^^^^^^^ reference semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#getCurrentModels().
// ^^^^ reference semanticdb maven jdk 11 java/util/List#size().
for (int i = 0; i < size; i++) {
// ^ definition local 39
// display_name i
// signature_documentation java int i
// enclosing_symbol semanticdb maven . . com/airbnb/epoxy/BaseEpoxyAdapter#getModelPosition().
// kind Variable
// ^ reference local 39
// ^^^^ reference local 38
// ^ reference local 39
Expand Down
Loading

0 comments on commit 79875d1

Please sign in to comment.