@@ -157,6 +157,9 @@ private void ParseInternalInternal(CancellationToken token)
157157        { 
158158            token . ThrowIfCancellationRequested ( ) ; 
159159
160+             _parserStateManager . SetStatusAndFireStateChanged ( this ,  ParserState . Pending ,  token ) ; 
161+             token . ThrowIfCancellationRequested ( ) ; 
162+ 
160163            _projectManager . RefreshProjects ( ) ; 
161164            token . ThrowIfCancellationRequested ( ) ; 
162165
@@ -327,6 +330,9 @@ private void ParseAllInternal(object requestor, CancellationToken token)
327330        { 
328331            token . ThrowIfCancellationRequested ( ) ; 
329332
333+             _parserStateManager . SetStatusAndFireStateChanged ( requestor ,  ParserState . ResolvedDeclarations ,  token ) ; 
334+             token . ThrowIfCancellationRequested ( ) ; 
335+ 
330336            Thread . Sleep ( 50 ) ;  //Simplistic hack to give the VBE time to do its work in case the parsing run is requested from an event handler.  
331337            token . ThrowIfCancellationRequested ( ) ; 
332338
@@ -349,10 +355,10 @@ private void ParseAllInternal(object requestor, CancellationToken token)
349355            { 
350356                if  ( componentsRemoved )   // trigger UI updates 
351357                { 
352-                     State . SetStatusAndFireStateChanged ( requestor ,  ParserState . ResolvedDeclarations ) ; 
358+                     _parserStateManager . SetStatusAndFireStateChanged ( requestor ,  ParserState . ResolvedDeclarations ,   token ) ; 
353359                } 
354360
355-                 State . SetStatusAndFireStateChanged ( requestor ,  State . Status ) ; 
361+                 _parserStateManager . SetStatusAndFireStateChanged ( requestor ,  State . Status ,   token ) ; 
356362                //return; // returning here leaves state in 'ResolvedDeclarations' when a module is removed, which disables refresh 
357363            } 
358364
0 commit comments