@@ -72,6 +72,7 @@ private void StateOnStateChanged(object sender, EventArgs e)
72
72
73
73
private void ReparseRequested ( object sender , ParseRequestEventArgs e )
74
74
{
75
+ _force = false ;
75
76
if ( e . IsFullReparseRequest )
76
77
{
77
78
Cancel ( ) ;
@@ -84,8 +85,10 @@ private void ReparseRequested(object sender, ParseRequestEventArgs e)
84
85
}
85
86
}
86
87
88
+ private bool _force ;
87
89
public void Parse ( )
88
90
{
91
+ _force = true ;
89
92
if ( ! _state . Projects . Any ( ) )
90
93
{
91
94
foreach ( var project in _vbe . VBProjects . Cast < VBProject > ( ) )
@@ -142,6 +145,7 @@ public void Parse()
142
145
/// </summary>
143
146
private void ParseAll ( )
144
147
{
148
+ _force = false ;
145
149
var projects = _state . Projects
146
150
. Where ( project => project . Protection == vbext_ProjectProtection . vbext_pp_none )
147
151
. ToList ( ) ;
@@ -283,9 +287,9 @@ private void ResolveInternal(CancellationToken token)
283
287
foreach ( var kvp in _state . ParseTrees )
284
288
{
285
289
var qualifiedName = kvp . Key ;
286
- if ( _state . IsModified ( qualifiedName ) )
290
+ if ( _force || _state . IsModified ( qualifiedName ) )
287
291
{
288
- Debug . WriteLine ( string . Format ( "Module '{0}' was modified since last parse. Walking parse tree for declarations..." , kvp . Key . ComponentName ) ) ;
292
+ Debug . WriteLine ( string . Format ( "Module '{0}' is new or was modified since last parse. Walking parse tree for declarations..." , kvp . Key . ComponentName ) ) ;
289
293
// modified module; walk parse tree and re-acquire all declarations
290
294
if ( token . IsCancellationRequested ) return ;
291
295
ResolveDeclarations ( qualifiedName . Component , kvp . Value ) ;
0 commit comments