Skip to content

Commit

Permalink
Improve the method overridden by analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Sep 22, 2023
1 parent 88da2fd commit e1fcc35
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Extensions/dnSpy.Analyzer/TreeNodes/MethodOverridesNode.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
Expand Down Expand Up @@ -50,6 +50,13 @@ IEnumerable<AnalyzerTreeNodeData> FindReferencesInType(TypeDef type) {
yield return new MethodNode(method, hidesParent) { Context = Context };
yield break;
}

foreach (var o in method.Overrides) {
if (o.MethodDeclaration.ResolveMethodDef() is MethodDef methodDecl && CheckEquals(methodDecl, analyzedMethod)) {
yield return new MethodNode(method) { Context = Context };
yield break;
}
}
}
}

Expand Down

0 comments on commit e1fcc35

Please sign in to comment.