Skip to content

Commit

Permalink
Fix "Find usages"
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Jun 2, 2024
1 parent bdd8473 commit 59f8203
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.github.dweindl.intellijantimony;

public class AntimonyIdentifierManipulator {
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ public AntimonyReference(@NotNull PsiElement element, TextRange textRange) {
@Override
public PsiElement resolve() {
ResolveResult[] resolveResults = multiResolve(false);
return resolveResults.length == 1 ? resolveResults[0].getElement() : null;
/*
What is to be considered the declaration in Antimony?
For now, we use the first occurrence of the identifier in the file?
*/
// This will show the "Choose declaration" popup, but it will break "find usages"
// return resolveResults.length == 1 ? resolveResults[0].getElement() : null;

// "Find usages" works only if resolve() returns a single element (independent of multiResolve())
return resolveResults.length >= 1 ? resolveResults[0].getElement() : null;
}

@Override
Expand Down

0 comments on commit 59f8203

Please sign in to comment.