Skip to content

Commit c0d947f

Browse files
committed
Correct the missed conditional for LOAD_USER_COM_PROJECTS
1 parent f202cad commit c0d947f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Rubberduck.Parsing/VBA/ParseCoordinator.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,7 @@ private void ExecuteCommonParseActivities(IReadOnlyCollection<QualifiedModuleNam
239239
_parserStateManager.SetStatusAndFireStateChanged(this, ParserState.LoadingReference, token);
240240
token.ThrowIfCancellationRequested();
241241

242-
RefreshUserComProjects(toParse, newProjectIds);
243-
token.ThrowIfCancellationRequested();
244-
245-
SyncDeclarationsFromUserComProjects(toParse, token, toReresolveReferences);
242+
ProcessUserComProjects(ref token, ref toParse, ref toReresolveReferences, ref newProjectIds);
246243

247244
SyncComReferences(toParse, token, toReresolveReferences);
248245
token.ThrowIfCancellationRequested();
@@ -337,6 +334,17 @@ private void ExecuteCommonParseActivities(IReadOnlyCollection<QualifiedModuleNam
337334
token.ThrowIfCancellationRequested();
338335
}
339336

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+
340348
private void SyncComReferences(IReadOnlyCollection<QualifiedModuleName> toParse, CancellationToken token, HashSet<QualifiedModuleName> toReresolveReferences)
341349
{
342350
_parsingStageService.SyncComReferences(token);

0 commit comments

Comments
 (0)