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;