@@ -124,73 +124,6 @@ public string Title
124124 /// </summary>
125125 public string TextContent => _manager . Document . GetText ( StartOffset , EndOffset - StartOffset ) ;
126126
127- /// <summary>
128- /// Gets the content of the collapsed lines as tooltip text.
129- /// </summary>
130- public string TooltipText
131- {
132- get
133- {
134- // This fixes SD-1394:
135- // Each line is checked for leading indentation whitespaces. If
136- // a line has the same or more indentation than the first line,
137- // it is reduced. If a line is less indented than the first line
138- // the indentation is removed completely.
139- //
140- // See the following example:
141- // line 1
142- // line 2
143- // line 3
144- // line 4
145- //
146- // is reduced to:
147- // line 1
148- // line 2
149- // line 3
150- // line 4
151-
152- var startLine = _manager . Document . GetLineByOffset ( StartOffset ) ;
153- var endLine = _manager . Document . GetLineByOffset ( EndOffset ) ;
154- var builder = new StringBuilder ( ) ;
155-
156- var current = startLine ;
157- ISegment startIndent = TextUtilities . GetLeadingWhitespace ( _manager . Document , startLine ) ;
158-
159- while ( current != endLine . NextLine )
160- {
161- ISegment currentIndent = TextUtilities . GetLeadingWhitespace ( _manager . Document , current ) ;
162-
163- if ( current == startLine && current == endLine )
164- builder . Append ( _manager . Document . GetText ( StartOffset , EndOffset - StartOffset ) ) ;
165- else if ( current == startLine )
166- {
167- if ( current . EndOffset - StartOffset > 0 )
168- builder . AppendLine ( _manager . Document . GetText ( StartOffset , current . EndOffset - StartOffset ) . TrimStart ( ) ) ;
169- }
170- else if ( current == endLine )
171- {
172- builder . Append ( startIndent . Length <= currentIndent . Length
173- ? _manager . Document . GetText ( current . Offset + startIndent . Length ,
174- EndOffset - current . Offset - startIndent . Length )
175- : _manager . Document . GetText ( current . Offset + currentIndent . Length ,
176- EndOffset - current . Offset - currentIndent . Length ) ) ;
177- }
178- else
179- {
180- builder . AppendLine ( startIndent . Length <= currentIndent . Length
181- ? _manager . Document . GetText ( current . Offset + startIndent . Length ,
182- current . Length - startIndent . Length )
183- : _manager . Document . GetText ( current . Offset + currentIndent . Length ,
184- current . Length - currentIndent . Length ) ) ;
185- }
186-
187- current = current . NextLine ;
188- }
189-
190- return builder . ToString ( ) ;
191- }
192- }
193-
194127 /// <summary>
195128 /// Gets/Sets an additional object associated with this folding section.
196129 /// </summary>
0 commit comments