Browse Source

Show a truncation notice when search hits the 1000-result cap

The search already stopped accepting results at 1000 and cancelled the
producer, but the user was never told the list had been truncated. Append
the "Search aborted, more than 1000 results found" row (a no-op to click).

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
3a1a133982
  1. 10
      ILSpy/Search/RunningSearch.cs

10
ILSpy/Search/RunningSearch.cs

@ -220,6 +220,16 @@ namespace ILSpy.Search @@ -220,6 +220,16 @@ namespace ILSpy.Search
// Stop the producer — anything it pushes from here would just be
// discarded, so why burn CPU on it.
cts.Cancel();
// Tell the user the list was truncated (appended after the sorted results; its
// null Reference makes it a no-op to click).
sink.Add(new SearchResult {
Name = ICSharpCode.ILSpy.Properties.Resources.SearchAbortedMoreThan1000ResultsFound,
Location = string.Empty,
Assembly = string.Empty,
Image = null!,
LocationImage = null!,
AssemblyImage = null!,
});
}
// Drain-discard any items still queued: without this the termination
// condition (runTask done + queue empty) never fires and the timer

Loading…
Cancel
Save