@@ -101,8 +101,8 @@ public override async Task ExecuteAsync(IModContext ctx, CancellationToken ct =
101101 }
102102
103103 // Find missing handle types
104- var handleDiscoverer = new MissingHandleTypeDiscoverer ( logger ) ;
105- var missingHandleTypes = handleDiscoverer . GetMissingHandleTypes ( compilation , ct ) ;
104+ var handleDiscoverer = new MissingHandleTypeDiscoverer ( logger , compilation , ct ) ;
105+ var missingHandleTypes = handleDiscoverer . GetMissingHandleTypes ( ) ;
106106
107107 // Second pass to modify project based on gathered data
108108 if ( cfg . GenerateEmptyStructsForMissingHandleTypes )
@@ -296,7 +296,7 @@ string nativeTypeName
296296 }
297297 }
298298
299- private class MissingHandleTypeDiscoverer ( ILogger logger ) : SymbolVisitor
299+ private class MissingHandleTypeDiscoverer ( ILogger logger , Compilation compilation , CancellationToken ct ) : SymbolVisitor
300300 {
301301 private readonly HashSet < IErrorTypeSymbol > _nonHandleTypes = new ( SymbolEqualityComparer . Default ) ;
302302 private readonly Dictionary < IErrorTypeSymbol , string > _missingTypes = new ( SymbolEqualityComparer . Default ) ;
@@ -307,10 +307,8 @@ private class MissingHandleTypeDiscoverer(ILogger logger) : SymbolVisitor
307307 /// <summary>
308308 /// Gets all missing handle types that are found and the namespace that they should be created in.
309309 /// </summary>
310- public Dictionary < IErrorTypeSymbol , string > GetMissingHandleTypes ( Compilation compilation , CancellationToken ct )
310+ public Dictionary < IErrorTypeSymbol , string > GetMissingHandleTypes ( )
311311 {
312- Clear ( ) ;
313-
314312 // We need to find and generate all missing handle types
315313 // Handle types are types that are only referenced through a pointer
316314 // We do this by parsing through the list of type errors
@@ -390,17 +388,6 @@ public Dictionary<IErrorTypeSymbol, string> GetMissingHandleTypes(Compilation co
390388 return new Dictionary < IErrorTypeSymbol , string > ( _missingTypes . Where ( kvp => ! _nonHandleTypes . Contains ( kvp . Key ) ) , SymbolEqualityComparer . Default ) ;
391389 }
392390
393- /// <summary>
394- /// Resets internal state.
395- /// </summary>
396- private void Clear ( )
397- {
398- _nonHandleTypes . Clear ( ) ;
399- _missingTypes . Clear ( ) ;
400- _currentNamespace = null ;
401- _pointerTypeDepth = 0 ;
402- }
403-
404391 public override void VisitMethod ( IMethodSymbol symbol )
405392 {
406393 base . VisitMethod ( symbol ) ;
0 commit comments