From c97c21a91f8b95fc492aecb635073d4410d1279c Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 26 Aug 2024 20:25:35 +0200 Subject: [PATCH] Add optional description to SearchResult.Found --- Rewrite/src/Rewrite.Core/Marker/SearchResult.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rewrite/src/Rewrite.Core/Marker/SearchResult.cs b/Rewrite/src/Rewrite.Core/Marker/SearchResult.cs index 98040078..e9ba2c5b 100644 --- a/Rewrite/src/Rewrite.Core/Marker/SearchResult.cs +++ b/Rewrite/src/Rewrite.Core/Marker/SearchResult.cs @@ -7,10 +7,10 @@ public bool Equals(Marker? other) return other is SearchResult && other.Id.Equals(Id); } - public static T Found(MutableTree tree) + public static T Found(MutableTree tree, string? Description = null) where T : class { - return tree.WithMarkers(tree.Markers.AddIfAbsent(new SearchResult(Tree.RandomId()))); + return tree.WithMarkers(tree.Markers.AddIfAbsent(new SearchResult(Tree.RandomId(), Description))); } public string Print(Cursor cursor, Func commentWrapper, bool verbose)