From afecb0d4be290d2195e6c1ebdcc862e1550765f6 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Mon, 26 Mar 2012 14:50:14 +0400 Subject: [PATCH] IDEA-83338 Groovy: Debugger: Quick Evaluate doesn't work for selection in classes --- .../plugins/groovy/debugger/GroovyCodeFragmentFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyCodeFragmentFactory.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyCodeFragmentFactory.java index 17c9260260f6..533a835ac1a2 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyCodeFragmentFactory.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyCodeFragmentFactory.java @@ -294,8 +294,10 @@ public class GroovyCodeFragmentFactory extends CodeFragmentFactory { PsiElement parent = context; while (parent != null) { if (parent instanceof PsiModifierListOwner && ((PsiModifierListOwner)parent).hasModifierProperty(PsiModifier.STATIC)) return true; - if (parent instanceof GrTypeDefinition || parent instanceof GroovyFile) return false; - parent = parent.getParent(); + if (parent instanceof GroovyFile && parent.isPhysical()) return false; + if (parent instanceof GrTypeDefinition) return false; + + parent = parent.getContext(); } return false;