@@ -54,32 +54,7 @@ public IVsTextView FindActiveView()
5454 return hresult == VSConstants . S_OK ? view : null ;
5555 }
5656
57- string GetText ( IVsTextView textView )
58- {
59- IVsTextLines buffer ;
60- ErrorHandler . ThrowOnFailure ( textView . GetBuffer ( out buffer ) ) ;
61-
62- int line ;
63- int index ;
64- ErrorHandler . ThrowOnFailure ( buffer . GetLastLineIndex ( out line , out index ) ) ;
65-
66- string text ;
67- ErrorHandler . ThrowOnFailure ( buffer . GetLineText ( 0 , 0 , line , index , out text ) ) ;
68- return text ;
69- }
70-
71- IVsTextView OpenDocument ( string fullPath )
72- {
73- var logicalView = VSConstants . LOGVIEWID . TextView_guid ;
74- IVsUIHierarchy hierarchy ;
75- uint itemID ;
76- IVsWindowFrame windowFrame ;
77- IVsTextView view ;
78- VsShellUtilities . OpenDocument ( serviceProvider , fullPath , logicalView , out hierarchy , out itemID , out windowFrame , out view ) ;
79- return view ;
80- }
81-
82- static int FindNearestMatchingLine ( IList < string > fromLines , IList < string > toLines , int line )
57+ public int FindNearestMatchingLine ( IList < string > fromLines , IList < string > toLines , int line )
8358 {
8459 line = line < fromLines . Count ? line : fromLines . Count - 1 ; // VS shows one extra line at end
8560 var fromLine = fromLines [ line ] ;
@@ -107,6 +82,31 @@ static int FindNearestMatchingLine(IList<string> fromLines, IList<string> toLine
10782 }
10883 }
10984
85+ string GetText ( IVsTextView textView )
86+ {
87+ IVsTextLines buffer ;
88+ ErrorHandler . ThrowOnFailure ( textView . GetBuffer ( out buffer ) ) ;
89+
90+ int line ;
91+ int index ;
92+ ErrorHandler . ThrowOnFailure ( buffer . GetLastLineIndex ( out line , out index ) ) ;
93+
94+ string text ;
95+ ErrorHandler . ThrowOnFailure ( buffer . GetLineText ( 0 , 0 , line , index , out text ) ) ;
96+ return text ;
97+ }
98+
99+ IVsTextView OpenDocument ( string fullPath )
100+ {
101+ var logicalView = VSConstants . LOGVIEWID . TextView_guid ;
102+ IVsUIHierarchy hierarchy ;
103+ uint itemID ;
104+ IVsWindowFrame windowFrame ;
105+ IVsTextView view ;
106+ VsShellUtilities . OpenDocument ( serviceProvider , fullPath , logicalView , out hierarchy , out itemID , out windowFrame , out view ) ;
107+ return view ;
108+ }
109+
110110 static IList < string > ReadLines ( string text )
111111 {
112112 var lines = new List < string > ( ) ;
0 commit comments