Skip to content

Commit 476d961

Browse files
committed
Make CE use the parser state event args rather than the raw parser status. This makes it update correctly when a component is removed.
1 parent 33436c3 commit 476d961

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,15 @@ public ObservableCollection<CodeExplorerItemViewModel> Projects
243243
}
244244
}
245245

246-
private void ParserState_StateChanged(object sender, EventArgs e)
246+
private void ParserState_StateChanged(object sender, ParserStateEventArgs e)
247247
{
248248
if (Projects == null)
249249
{
250250
Projects = new ObservableCollection<CodeExplorerItemViewModel>();
251251
}
252252

253253
IsBusy = _state.Status < ParserState.ResolvedDeclarations;
254-
if (_state.Status != ParserState.ResolvedDeclarations)
254+
if (e.State != ParserState.ResolvedDeclarations)
255255
{
256256
return;
257257
}

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ public void ClearStateCache(VBProject project, bool notifyStateChanged = false)
584584

585585
if (notifyStateChanged)
586586
{
587-
OnStateChanged();
587+
OnStateChanged(ParserState.ResolvedDeclarations); // trigger test explorer and code explorer updates
588+
OnStateChanged(ParserState.Ready); // trigger find all references &c. updates
588589
}
589590
}
590591

@@ -675,7 +676,8 @@ public bool ClearStateCache(VBComponent component, bool notifyStateChanged = fal
675676

676677
if (notifyStateChanged)
677678
{
678-
OnStateChanged();
679+
OnStateChanged(ParserState.ResolvedDeclarations); // trigger test explorer and code explorer updates
680+
OnStateChanged(ParserState.Ready); // trigger find all references &c. updates
679681
}
680682

681683
return success;
@@ -697,7 +699,8 @@ public bool RemoveRenamedComponent(VBComponent component, string oldComponentNam
697699

698700
if (success)
699701
{
700-
OnStateChanged();
702+
OnStateChanged(ParserState.ResolvedDeclarations); // trigger test explorer and code explorer updates
703+
OnStateChanged(ParserState.Ready); // trigger find all references &c. updates
701704
}
702705
return success;
703706
}

0 commit comments

Comments
 (0)