@@ -56,6 +56,18 @@ public IVsTextView FindActiveView()
5656 return hresult == VSConstants . S_OK ? view : null ;
5757 }
5858
59+ /// <summary>
60+ /// Find the closest matching line in <see cref="toLines"/>.
61+ /// </summary>
62+ /// <remarks>
63+ /// When matching we prioritize unique matching lines in <see cref="toLines"/>. If the target line isn't
64+ /// unique, continue searching the lines above for a better match and use this as anchor with an offset.
65+ /// The closest match to <see cref="line"/> with the fewest duplicate matches will be used for the matching line.
66+ /// </remarks>
67+ /// <param name="fromLines">The document we're navigating from.</param>
68+ /// <param name="toLines">The document we're navigating to.</param>
69+ /// <param name="line">The 0-based line we're navigating from.</param>
70+ /// <returns>The best matching line in <see cref="toLines"/></returns>
5971 public int FindMatchingLine ( IList < string > fromLines , IList < string > toLines , int line )
6072 {
6173 var matchingLine = - 1 ;
@@ -93,6 +105,14 @@ public int FindMatchingLine(IList<string> fromLines, IList<string> toLines, int
93105 return matchingLine ;
94106 }
95107
108+ /// <summary>
109+ /// Find the nearest matching line to <see cref="line"/> and the number of similar matched lines in the text.
110+ /// </summary>
111+ /// <param name="fromLines">The document we're navigating from.</param>
112+ /// <param name="toLines">The document we're navigating to.</param>
113+ /// <param name="line">The 0-based line we're navigating from.</param>
114+ /// <param name="matchedLines">The number of similar matched lines in <see cref="toLines"/></param>
115+ /// <returns>Find the nearest matching line in <see cref="toLines"/>.</returns>
96116 public int FindNearestMatchingLine ( IList < string > fromLines , IList < string > toLines , int line , out int matchedLines )
97117 {
98118 line = line < fromLines . Count ? line : fromLines . Count - 1 ; // VS shows one extra line at end
0 commit comments