Comparable (@NotNull LookupElement element, @NotNull CompletionLocation location) { PsiFile containingFile = location.getCompletionParameters().getPosition().getContainingFile(); if (!(containingFile instanceof GroovyFileBase)) { return null; } if (!"pom.groovy".equals(containingFile.getName())) return null; Object o = element.getObject(); if (o instanceof ResolveResult) { o = ((ResolveResult)o).getElement(); } if (o instanceof DynamicMemberUtils.DynamicElement) { return 1; } else { return -1; } }