@@ -239,10 +239,7 @@ private void ExecuteCommonParseActivities(IReadOnlyCollection<QualifiedModuleNam
239
239
_parserStateManager . SetStatusAndFireStateChanged ( this , ParserState . LoadingReference , token ) ;
240
240
token . ThrowIfCancellationRequested ( ) ;
241
241
242
- RefreshUserComProjects ( toParse , newProjectIds ) ;
243
- token . ThrowIfCancellationRequested ( ) ;
244
-
245
- SyncDeclarationsFromUserComProjects ( toParse , token , toReresolveReferences ) ;
242
+ ProcessUserComProjects ( ref token , ref toParse , ref toReresolveReferences , ref newProjectIds ) ;
246
243
247
244
SyncComReferences ( toParse , token , toReresolveReferences ) ;
248
245
token . ThrowIfCancellationRequested ( ) ;
@@ -337,6 +334,17 @@ private void ExecuteCommonParseActivities(IReadOnlyCollection<QualifiedModuleNam
337
334
token . ThrowIfCancellationRequested ( ) ;
338
335
}
339
336
337
+ //TODO: Remove the conditional compilation after loading from typelibs actually works.
338
+ //TODO: Improve the handling to avoid host crashing. See https://github.com/rubberduck-vba/Rubberduck/issues/5217
339
+ [ Conditional ( "LOAD_USER_COM_PROJECTS" ) ]
340
+ private void ProcessUserComProjects ( ref CancellationToken token , ref IReadOnlyCollection < QualifiedModuleName > toParse , ref HashSet < QualifiedModuleName > toReresolveReferences , ref IReadOnlyCollection < string > newProjectIds )
341
+ {
342
+ RefreshUserComProjects ( toParse , newProjectIds ) ;
343
+ token . ThrowIfCancellationRequested ( ) ;
344
+
345
+ SyncDeclarationsFromUserComProjects ( toParse , token , toReresolveReferences ) ;
346
+ }
347
+
340
348
private void SyncComReferences ( IReadOnlyCollection < QualifiedModuleName > toParse , CancellationToken token , HashSet < QualifiedModuleName > toReresolveReferences )
341
349
{
342
350
_parsingStageService . SyncComReferences ( token ) ;
0 commit comments