From bb9067e2a8f8bd83bfcdb6809a1fa2fd8f65da0d Mon Sep 17 00:00:00 2001 From: Tomasz Pasternak Date: Mon, 31 Aug 2020 18:43:02 +0200 Subject: [PATCH] Extend set of supported entities for GoToThriftDefinitionMarkerProvider (#94) More scrooge types, as well as all generated classes --- .../editor/GoToThriftDefinitionMarkerProvider.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/thrift/src/main/java/com/intellij/plugins/thrift/editor/GoToThriftDefinitionMarkerProvider.java b/thrift/src/main/java/com/intellij/plugins/thrift/editor/GoToThriftDefinitionMarkerProvider.java index b23f6863..f36db53f 100644 --- a/thrift/src/main/java/com/intellij/plugins/thrift/editor/GoToThriftDefinitionMarkerProvider.java +++ b/thrift/src/main/java/com/intellij/plugins/thrift/editor/GoToThriftDefinitionMarkerProvider.java @@ -34,12 +34,18 @@ public class GoToThriftDefinitionMarkerProvider extends RelatedItemLineMarkerPro private static Set 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