element = (element != null) ? element.getParent() : null;
final List<PsiElement> usages = new ArrayList<PsiElement>();
if (element instanceof Symbol) {
// usages.add(element);
final PsiReference ref = element.getReference();
if (ref != null) {
final PsiElement resolve = ref.resolve();
if (resolve != null && resolve instanceof Symbol) {
if (!resolve.equals(element))
usages.add(resolve);
final Collection<Symbol> symbolsInFile = PsiTreeUtil.findChildrenOfType(psiFile, Symbol.class);
for (Symbol symbol : symbolsInFile) {
final PsiReference reference = symbol.getReference();
if (reference != null) {
final PsiElement resolve1 = reference.resolve();
if (resolve1 != null && !symbol.equals(resolve1) && resolve.equals(resolve1)) {
usages.add(symbol);
}
}
}