@@ -28,7 +28,7 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
28
28
_folderHelper = folderHelper ;
29
29
_state = state ;
30
30
_state . StateChanged += ParserState_StateChanged ;
31
-
31
+
32
32
_refreshCommand = new DelegateCommand ( param => _state . OnParseRequested ( this ) ,
33
33
param => ! IsBusy && _state . IsDirty ( ) ) ;
34
34
@@ -188,38 +188,38 @@ public string PanelTitle
188
188
189
189
if ( SelectedItem is CodeExplorerProjectViewModel )
190
190
{
191
- var node = ( CodeExplorerProjectViewModel ) SelectedItem ;
191
+ var node = ( CodeExplorerProjectViewModel ) SelectedItem ;
192
192
return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
193
193
}
194
194
195
195
if ( SelectedItem is CodeExplorerComponentViewModel )
196
196
{
197
- var node = ( CodeExplorerComponentViewModel ) SelectedItem ;
197
+ var node = ( CodeExplorerComponentViewModel ) SelectedItem ;
198
198
return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
199
199
}
200
200
201
201
if ( SelectedItem is CodeExplorerMemberViewModel )
202
202
{
203
- var node = ( CodeExplorerMemberViewModel ) SelectedItem ;
203
+ var node = ( CodeExplorerMemberViewModel ) SelectedItem ;
204
204
return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
205
205
}
206
206
207
207
return SelectedItem . Name ;
208
208
}
209
209
}
210
-
210
+
211
211
public string Description
212
212
{
213
213
get
214
214
{
215
215
if ( SelectedItem is ICodeExplorerDeclarationViewModel )
216
216
{
217
- return ( ( ICodeExplorerDeclarationViewModel ) SelectedItem ) . Declaration . DescriptionString ;
217
+ return ( ( ICodeExplorerDeclarationViewModel ) SelectedItem ) . Declaration . DescriptionString ;
218
218
}
219
219
220
220
if ( SelectedItem is CodeExplorerCustomFolderViewModel )
221
221
{
222
- return ( ( CodeExplorerCustomFolderViewModel ) SelectedItem ) . FolderAttribute ;
222
+ return ( ( CodeExplorerCustomFolderViewModel ) SelectedItem ) . FolderAttribute ;
223
223
}
224
224
225
225
return string . Empty ;
@@ -237,7 +237,7 @@ public ObservableCollection<CodeExplorerItemViewModel> Projects
237
237
set
238
238
{
239
239
_projects = new ObservableCollection < CodeExplorerItemViewModel > ( value . OrderBy ( o => o . NameWithSignature ) ) ;
240
-
240
+
241
241
ReorderChildNodes ( _projects ) ;
242
242
OnPropertyChanged ( ) ;
243
243
}
@@ -250,12 +250,12 @@ private void ParserState_StateChanged(object sender, EventArgs e)
250
250
Projects = new ObservableCollection < CodeExplorerItemViewModel > ( ) ;
251
251
}
252
252
253
- IsBusy = _state . Status == ParserState . Parsing ;
254
- if ( _state . Status != ParserState . Ready )
253
+ IsBusy = _state . Status < ParserState . ResolvedDeclarations ;
254
+ if ( _state . Status != ParserState . ResolvedDeclarations )
255
255
{
256
256
return ;
257
257
}
258
-
258
+
259
259
var userDeclarations = _state . AllUserDeclarations
260
260
. GroupBy ( declaration => declaration . Project )
261
261
. Where ( grouping => grouping . Key != null )
@@ -273,7 +273,7 @@ private void ParserState_StateChanged(object sender, EventArgs e)
273
273
grouping ) ) . ToList ( ) ;
274
274
275
275
UpdateNodes ( Projects , newProjects ) ;
276
-
276
+
277
277
Projects = new ObservableCollection < CodeExplorerItemViewModel > ( newProjects ) ;
278
278
}
279
279
@@ -403,7 +403,7 @@ private void SetErrorState(CodeExplorerItemViewModel itemNode, VBComponent compo
403
403
404
404
if ( node is CodeExplorerComponentViewModel )
405
405
{
406
- var componentNode = ( CodeExplorerComponentViewModel ) node ;
406
+ var componentNode = ( CodeExplorerComponentViewModel ) node ;
407
407
if ( componentNode . GetSelectedDeclaration ( ) . QualifiedName . QualifiedModuleName . Component == component )
408
408
{
409
409
componentNode . IsErrorState = true ;
@@ -472,8 +472,8 @@ private void SetErrorState(CodeExplorerItemViewModel itemNode, VBComponent compo
472
472
// this is a special case--we have to reset SelectedItem to prevent a crash
473
473
private void ExecuteRemoveComand ( object param )
474
474
{
475
- var node = ( CodeExplorerComponentViewModel ) SelectedItem ;
476
- SelectedItem = Projects . First ( p => ( ( CodeExplorerProjectViewModel ) p ) . Declaration . Project == node . Declaration . Project ) ;
475
+ var node = ( CodeExplorerComponentViewModel ) SelectedItem ;
476
+ SelectedItem = Projects . First ( p => ( ( CodeExplorerProjectViewModel ) p ) . Declaration . Project == node . Declaration . Project ) ;
477
477
478
478
_externalRemoveCommand . Execute ( param ) ;
479
479
}
0 commit comments