mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix: IDEA-59171(Groovy: Expression Evaluation dialog does not work for groovy expressions.)
This commit is contained in:
@@ -562,11 +562,15 @@ public class PsiUtil {
|
||||
|
||||
@Nullable
|
||||
public static PsiClass getContextClass(PsiElement context) {
|
||||
GroovyPsiElement parent = PsiTreeUtil.getParentOfType(context, GrTypeDefinition.class, GroovyFileBase.class);
|
||||
if (parent instanceof GrTypeDefinition) {
|
||||
return (PsiClass)parent;
|
||||
} else if (parent instanceof GroovyFileBase) {
|
||||
return ((GroovyFileBase)parent).getScriptClass();
|
||||
while (context != null) {
|
||||
if (context instanceof GrTypeDefinition) {
|
||||
return (PsiClass)context;
|
||||
}
|
||||
else if (context instanceof GroovyFileBase) {
|
||||
return ((GroovyFileBase)context).getScriptClass();
|
||||
}
|
||||
|
||||
context = context.getContext();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user