Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
Extend set of supported entities for GoToThriftDefinitionMarkerProvid…
Browse files Browse the repository at this point in the history
…er (#94)

More scrooge types, as well as all generated classes
  • Loading branch information
Tomasz Pasternak authored Aug 31, 2020
1 parent 92950d1 commit bb9067e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ public class GoToThriftDefinitionMarkerProvider extends RelatedItemLineMarkerPro

private static Set<String> thriftStructBaseClasses =
Sets.newHashSet(
"org.apache.thrift.TBase",
"com.twitter.scrooge.ThriftStruct",
"org.apache.thrift.TBase"
"com.twitter.scrooge.ThriftEnum",
"com.twitter.scrooge.ThriftUnion",
"com.twitter.scrooge.ThriftException"
);

private boolean isThriftStruct(PsiClass element) {
return Arrays.stream(element.getSupers()).anyMatch(superClass -> thriftStructBaseClasses.contains(superClass.getQualifiedName()));
return Arrays
.stream(element.getSupers())
.anyMatch(superClass -> thriftStructBaseClasses.contains(superClass.getQualifiedName()))
|| element.getAnnotation("javax.annotation.Generated") != null;
}

@Override
Expand Down

0 comments on commit bb9067e

Please sign in to comment.