PsiElement (final PsiElement element, boolean skipReference) { PsiElement prev = element; if(element != null){ if(skipReference){ prev = FilterPositionUtil.searchNonSpaceNonCommentBack(element); while(prev != null && prev.getParent() instanceof PsiJavaCodeReferenceElement){ prev = FilterPositionUtil.searchNonSpaceNonCommentBack(prev.getParent()); } } else{ prev = FilterPositionUtil.searchNonSpaceNonCommentBack(prev); } } return prev; }