From ffb75b6981b28fcfdba9f0dc385b6976122c6e9b Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Fri, 7 May 2021 00:11:05 -0400 Subject: [PATCH] make FindAllImplementations work on class modules again. --- Rubberduck.Core/UI/Controls/FindAllImplementationsService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rubberduck.Core/UI/Controls/FindAllImplementationsService.cs b/Rubberduck.Core/UI/Controls/FindAllImplementationsService.cs index f8ec68a53e..3c8962438c 100644 --- a/Rubberduck.Core/UI/Controls/FindAllImplementationsService.cs +++ b/Rubberduck.Core/UI/Controls/FindAllImplementationsService.cs @@ -38,7 +38,7 @@ public class FindAllImplementationsService : IDisposable public bool CanFind(Declaration declaration) { - return declaration is ModuleBodyElementDeclaration moduleBody && + return declaration is ClassModuleDeclaration || declaration is ModuleBodyElementDeclaration moduleBody && moduleBody.Accessibility == Accessibility.Public && declaration.ParentDeclaration is ClassModuleDeclaration; } @@ -151,7 +151,7 @@ private SearchResultsViewModel CreateViewModel(Declaration target) var results = implementations.Select(declaration => new SearchResultItem( - declaration.ParentScopeDeclaration, + declaration is ClassModuleDeclaration ? declaration : declaration.ParentScopeDeclaration, new NavigateCodeEventArgs(declaration.QualifiedName.QualifiedModuleName, declaration.Selection), GetModuleLine(declaration.QualifiedName.QualifiedModuleName, declaration.Selection.StartLine)));