Skip to content

Commit

Permalink
#311 - If multiple implementations found, get the latest
Browse files Browse the repository at this point in the history
  • Loading branch information
giraud committed Mar 30, 2021
1 parent dc0b34f commit d206aec
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/com/reason/ide/go/ORLineMarkerProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected void collectNavigationMarkers(@NotNull PsiElement element, @NotNull Co
}
}

private <T extends PsiQualifiedElement> void extractRelatedExpressions(
@SafeVarargs private final <T extends PsiQualifiedElement> void extractRelatedExpressions(
@Nullable PsiElement element,
@Nullable String qname,
@NotNull Collection<? super RelatedItemLineMarkerInfo<?>> result,
Expand All @@ -93,8 +93,13 @@ private <T extends PsiQualifiedElement> void extractRelatedExpressions(
PsiFinder.getInstance(containingFile.getProject()).findRelatedFile(containingFile);
if (psiRelatedFile != null) {
List<T> expressions = psiRelatedFile.getQualifiedExpressions(qname, clazz);
if (expressions.size() == 1) {
T relatedElement = expressions.iterator().next();
if (expressions.size() >= 1) {
// Get latest
T relatedElement = null;
for (T expression : expressions) {
relatedElement = expression;
}

if (relatedElement != null) {
boolean isInterface = containingFile.isInterface();
String tooltip =
Expand Down

0 comments on commit d206aec

Please sign in to comment.