Filter out duplicate navigation targets for references in library source

This commit is contained in:
Pavel V. Talanov
2014-12-18 19:48:53 +03:00
parent 7684e08000
commit 24f1635d2c
@@ -57,7 +57,9 @@ public object DescriptorToDeclarationUtil {
result.addIfNotNull(psiFacade.findPackage(fqName))
result.addIfNotNull(psiFacade.findClass(fqName, project.allScope()))
}
return result
// filter out elements which are navigate to some other element of the result
// this is needed to avoid duplicated results for references to declaration in same library source file
return result.filter { element -> result.none { element != it && it.getNavigationElement() == element } }
}
private fun findDecompiledAndBuiltInDeclarations(project: Project, descriptor: DeclarationDescriptor): Collection<PsiElement> {