PsiElement (SourcePosition position) { PsiFile file = position.getFile(); if (!(file instanceof GroovyFileBase) && !(file instanceof PsiJavaFile)) return null; return file.findElementAt(position.getOffset()); }