Browse Source

Fix #3064: Do not only match the full assembly name, but also try to match the filename when applying the "inassembly:" search filter.

pull/3111/head
Siegfried Pammer 3 years ago
parent
commit
ce891da793
  1. 5
      ICSharpCode.ILSpyX/Search/AbstractEntitySearchStrategy.cs

5
ICSharpCode.ILSpyX/Search/AbstractEntitySearchStrategy.cs

@ -18,6 +18,7 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.IO;
namespace ICSharpCode.ILSpyX.Search namespace ICSharpCode.ILSpyX.Search
{ {
@ -66,7 +67,9 @@ namespace ICSharpCode.ILSpyX.Search
{ {
if (searchRequest.InAssembly != null) if (searchRequest.InAssembly != null)
{ {
if (entity.ParentModule == null || !entity.ParentModule.FullAssemblyName.Contains(searchRequest.InAssembly, StringComparison.OrdinalIgnoreCase)) if (entity.ParentModule?.PEFile == null ||
!(Path.GetFileName(entity.ParentModule.PEFile.FileName).Contains(searchRequest.InAssembly, StringComparison.OrdinalIgnoreCase)
|| entity.ParentModule.FullAssemblyName.Contains(searchRequest.InAssembly, StringComparison.OrdinalIgnoreCase)))
{ {
return false; return false;
} }

Loading…
Cancel
Save