fix(gui): exclude declaration from usage list (#1110)

This commit is contained in:
Skylot 2021-08-22 18:02:50 +01:00
parent 1ce3fc972a
commit 90fbc790d9
No known key found for this signature in database
GPG Key ID: 1E23F5B52567AA39

View File

@ -50,6 +50,11 @@ public class CodeUsageInfo {
for (Map.Entry<CodePosition, JavaNode> entry : usage.entrySet()) {
CodePosition codePosition = entry.getKey();
JavaNode javaNode = entry.getValue();
if (javaNode.getTopParentClass().equals(javaClass)
&& codePosition.getPos() == javaNode.getDefPos()) {
// skip declaration
continue;
}
addUsage(nodeCache.makeFrom(javaNode), javaClass, linesInfo, codePosition, lines);
}
} catch (Exception e) {