44using System . IO ;
55using System . Linq ;
66using System . Windows . Forms ;
7- using ASCompletion ;
87using ASCompletion . Context ;
98using ASCompletion . Model ;
109using JetBrains . Annotations ;
@@ -26,7 +25,7 @@ public sealed partial class TypeExplorerForm : QuickForm
2625 [ NotNull ] readonly Dictionary < Button , string > filterToDisabledTip = new Dictionary < Button , string > ( ) ;
2726 [ NotNull ] readonly Dictionary < FlagType , Button > flagToFilter = new Dictionary < FlagType , Button > ( ) ;
2827 [ NotNull ] readonly Timer timer = new Timer ( ) ;
29- private int filesCount ;
28+ int filesCount ;
3029
3130 /// <summary>
3231 /// Initializes a new instance of the QuickNavigate.Controls.TypeExplorer
@@ -149,28 +148,28 @@ void RefreshTree()
149148 tree . Nodes . Clear ( ) ;
150149 if ( selectedNode == null )
151150 {
152- if ( search . Length == 0 ) FillTree ( ) ;
153- else FillTree ( search ) ;
151+ if ( search . Length == 0 ) FillNodes ( tree . Nodes ) ;
152+ else FillNodes ( tree . Nodes , search ) ;
154153 tree . SelectedNode = tree . TopNode ;
155154 }
156155 else
157156 {
158157 selectedNode . Nodes . Clear ( ) ;
159158 tree . Nodes . Add ( selectedNode ) ;
160- FillTree ( selectedNode , search ) ;
159+ FillNodes ( selectedNode . Nodes , selectedNode . Model , search ) ;
161160 tree . SelectedNode = selectedNode . FirstNode ?? selectedNode ;
162161 }
163162 tree . ExpandAll ( ) ;
164163 tree . EndUpdate ( ) ;
165164 }
166165
167- void FillTree ( )
166+ void FillNodes ( TreeNodeCollection nodes )
168167 {
169168 var openedTypes = FilterTypes ( this . openedTypes . ToList ( ) ) ;
170- if ( openedTypes . Count > 0 ) tree . Nodes . AddRange ( CreateNodes ( openedTypes , string . Empty ) . ToArray ( ) ) ;
169+ if ( openedTypes . Count > 0 ) nodes . AddRange ( CreateNodes ( openedTypes , string . Empty ) . ToArray ( ) ) ;
171170 }
172171
173- void FillTree ( string search )
172+ void FillNodes ( TreeNodeCollection nodes , string search )
174173 {
175174 var openedTypes = FilterTypes ( this . openedTypes . ToList ( ) ) ;
176175 var closedTypes = FilterTypes ( this . closedTypes . ToList ( ) ) ;
@@ -190,20 +189,17 @@ void FillTree(string search)
190189 else closedMatches = SearchUtil . FindAll ( closedTypes , search ) ;
191190 var hasOpenedMatches = openedMatches . Count > 0 ;
192191 var hasClosedMatches = closedMatches . Count > 0 ;
193- if ( hasOpenedMatches ) tree . Nodes . AddRange ( CreateNodes ( openedMatches , search ) . ToArray ( ) ) ;
192+ if ( hasOpenedMatches ) nodes . AddRange ( CreateNodes ( openedMatches , search ) . ToArray ( ) ) ;
194193 if ( Settings . EnableItemSpacer && hasOpenedMatches && hasClosedMatches )
195- tree . Nodes . Add ( Settings . ItemSpacer ) ;
196- if ( hasClosedMatches ) tree . Nodes . AddRange ( CreateNodes ( closedMatches , search ) . ToArray ( ) ) ;
194+ nodes . Add ( Settings . ItemSpacer ) ;
195+ if ( hasClosedMatches ) nodes . AddRange ( CreateNodes ( closedMatches , search ) . ToArray ( ) ) ;
197196 }
198197
199- void FillTree ( ClassNode node , string search )
198+ void FillNodes ( TreeNodeCollection nodes , ClassModel inClass , string search )
200199 {
201- var nodes = node . Nodes ;
202- var currentClass = node . Model ;
203- var inFile = currentClass . InFile ;
200+ var inFile = inClass . InFile ;
204201 var isHaxe = inFile . haXe ;
205- var items = currentClass . Members . Items ;
206- if ( search . Length > 0 ) items = SearchUtil . FindAll ( items , search ) ;
202+ var items = SearchUtil . FindAll ( inClass . Members . Items , search ) ;
207203 foreach ( var it in items )
208204 {
209205 nodes . Add ( NodeFactory . CreateTreeNode ( inFile , isHaxe , it ) ) ;
0 commit comments