Skip to content

Commit 26c721e

Browse files
committed
Close #1219
1 parent bdb6d46 commit 26c721e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Windows.Input;
66
using Microsoft.Vbe.Interop;
77
using Ninject;
8+
using Rubberduck.Parsing.VBA;
89
using Rubberduck.Settings;
910
using Rubberduck.SourceControl;
1011
using Rubberduck.UI.Command;
@@ -15,6 +16,7 @@ namespace Rubberduck.UI.SourceControl
1516
public class SourceControlViewViewModel : ViewModelBase
1617
{
1718
private readonly VBE _vbe;
19+
private readonly RubberduckParserState _state;
1820
private readonly ISourceControlProviderFactory _providerFactory;
1921
private readonly IFolderBrowserFactory _folderBrowserFactory;
2022
private readonly IConfigurationService<SourceControlConfiguration> _configService;
@@ -23,6 +25,7 @@ public class SourceControlViewViewModel : ViewModelBase
2325

2426
public SourceControlViewViewModel(
2527
VBE vbe,
28+
RubberduckParserState state,
2629
ISourceControlProviderFactory providerFactory,
2730
IFolderBrowserFactory folderBrowserFactory,
2831
IConfigurationService<SourceControlConfiguration> configService,
@@ -33,9 +36,12 @@ public SourceControlViewViewModel(
3336
ICodePaneWrapperFactory wrapperFactory)
3437
{
3538
_vbe = vbe;
39+
_state = state;
3640
_providerFactory = providerFactory;
3741
_folderBrowserFactory = folderBrowserFactory;
3842

43+
_state.StateChanged += _state_StateChanged;
44+
3945
_configService = configService;
4046
_config = _configService.LoadConfiguration();
4147
_wrapperFactory = wrapperFactory;
@@ -63,6 +69,14 @@ public SourceControlViewViewModel(
6369
ListenForErrors();
6470
}
6571

72+
private void _state_StateChanged(object sender, ParserStateEventArgs e)
73+
{
74+
if (e.State == ParserState.Parsed)
75+
{
76+
Refresh();
77+
}
78+
}
79+
6680
private ISourceControlProvider _provider;
6781
public ISourceControlProvider Provider
6882
{

0 commit comments

Comments
 (0)