@@ -33,7 +33,6 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
3333 var setup = ctx . Setup ;
3434 var nodes = ctx . Nodes ;
3535 var accumulators = ctx . Accumulators ;
36- var nodesCache = ctx . NodesCache ;
3736 var nodesLength = nodes . Length ;
3837 var map = new Dictionary < Injection , DependencyNode > ( nodesLength ) ;
3938 var contextMap = new Dictionary < Injection , DependencyNode > ( nodesLength ) ;
@@ -120,7 +119,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
120119 var contextTag = GetContextTag ( injection , newNode ) ;
121120 var newInjection = injection with { Tag = contextTag ?? injection . Tag } ;
122121 edges . Add ( new Dependency ( true , newNode , newInjection , targetNode , position ) ) ;
123- queue . Enqueue ( CreateNewProcessingNode ( nodesCache , newInjection . Tag , newNode ) ) ;
122+ queue . Enqueue ( CreateNewProcessingNode ( newInjection . Tag , newNode ) ) ;
124123 }
125124
126125 continue ;
@@ -135,7 +134,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
135134 {
136135 if ( ! marker . IsMarkerBased ( setup , sourceNode ! . Type ) )
137136 {
138- queue . Enqueue ( CreateNewProcessingNode ( nodesCache , injection . Tag , sourceNode ) ) ;
137+ queue . Enqueue ( CreateNewProcessingNode ( injection . Tag , sourceNode ) ) ;
139138 continue ;
140139 }
141140 }
@@ -156,7 +155,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
156155 {
157156 var contextTag = GetContextTag ( injection , newNode ) ;
158157 var newInjection = injection with { Tag = contextTag ?? injection . Tag } ;
159- var newProcessingNode = CreateNewProcessingNode ( nodesCache , newInjection . Tag , newNode ) ;
158+ var newProcessingNode = CreateNewProcessingNode ( newInjection . Tag , newNode ) ;
160159 UpdateMap ( newInjection , newNode ) ;
161160 queue . Enqueue ( newProcessingNode ) ;
162161 }
@@ -207,7 +206,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
207206 if ( genericNode is not null )
208207 {
209208 UpdateMap ( newInjection , genericNode ) ;
210- queue . Enqueue ( CreateNewProcessingNode ( nodesCache , newInjection . Tag , genericNode ) ) ;
209+ queue . Enqueue ( CreateNewProcessingNode ( newInjection . Tag , genericNode ) ) ;
211210 foreach ( var contract in genericBinding . Contracts . Where ( i => i . ContractType is not null ) )
212211 {
213212 foreach ( var tag in contract . Tags . Select ( i => i . Value ) . DefaultIfEmpty ( null ) )
@@ -265,7 +264,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
265264 var contextTag = GetContextTag ( injection , newNode ) ;
266265 var newInjection = injection with { Tag = contextTag ?? injection . Tag } ;
267266 UpdateMap ( newInjection , newNode ) ;
268- var processingNode = CreateNewProcessingNode ( nodesCache , newInjection . Tag , newNode ) ;
267+ var processingNode = CreateNewProcessingNode ( newInjection . Tag , newNode ) ;
269268 queue . Enqueue ( processingNode ) ;
270269 }
271270
@@ -274,7 +273,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
274273 }
275274
276275 // OnCannotResolve
277- if ( TryCreateOnCannotResolve ( nodesCache , setup , typeConstructor , targetNode , injection , ref maxBindingId , map , processed ) )
276+ if ( TryCreateOnCannotResolve ( setup , typeConstructor , targetNode , injection , ref maxBindingId , map , processed ) )
278277 {
279278 continue ;
280279 }
@@ -300,7 +299,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
300299 var contextTag = GetContextTag ( injection , newNode ) ;
301300 var newInjection = injection with { Tag = contextTag ?? injection . Tag } ;
302301 UpdateMap ( newInjection , newNode ) ;
303- queue . Enqueue ( CreateNewProcessingNode ( nodesCache , newInjection . Tag , newNode ) ) ;
302+ queue . Enqueue ( CreateNewProcessingNode ( newInjection . Tag , newNode ) ) ;
304303 }
305304
306305 continue ;
@@ -358,7 +357,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
358357 var contextTag = GetContextTag ( injection , newNode ) ;
359358 var newInjection = injection with { Tag = contextTag ?? injection . Tag } ;
360359 UpdateMap ( newInjection , newNode ) ;
361- queue . Enqueue ( CreateNewProcessingNode ( nodesCache , newInjection . Tag , newNode ) ) ;
360+ queue . Enqueue ( CreateNewProcessingNode ( newInjection . Tag , newNode ) ) ;
362361 }
363362
364363 continue ;
@@ -383,6 +382,11 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
383382
384383 if ( ! disableAutoBinding )
385384 {
385+ /*if (!Debugger.IsAttached)
386+ {
387+ Debugger.Launch();
388+ }*/
389+
386390 var autoBinding = bindingsFactory . CreateAutoBinding ( setup , targetNode , injection , typeConstructor , ++ maxBindingId ) ;
387391 var autoNodes = dependencyNodePrioritizer . SortByPriority ( nodesFactory . CreateNodes ( setup , typeConstructor , autoBinding ) ) . ToList ( ) ;
388392 foreach ( var autoNode in autoNodes )
@@ -399,7 +403,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
399403 {
400404 var contextTag = GetContextTag ( injection , newNode ) ;
401405 var newInjection = injection with { Tag = contextTag ?? injection . Tag } ;
402- var newProcessingNode = CreateNewProcessingNode ( nodesCache , newInjection . Tag , newNode ) ;
406+ var newProcessingNode = CreateNewProcessingNode ( newInjection . Tag , newNode ) ;
403407 UpdateMap ( newInjection , newNode ) ;
404408 queue . Enqueue ( newProcessingNode ) ;
405409 }
@@ -409,7 +413,7 @@ public IEnumerable<DependencyNode> Build(GraphBuildContext ctx)
409413 }
410414
411415 // OnCannotResolve
412- if ( TryCreateOnCannotResolve ( nodesCache , setup , typeConstructor , targetNode , injection , ref maxBindingId , map , processed ) )
416+ if ( TryCreateOnCannotResolve ( setup , typeConstructor , targetNode , injection , ref maxBindingId , map , processed ) )
413417 {
414418 continue ;
415419 }
@@ -513,9 +517,7 @@ private MdConstructKind GetConstructKind(INamedTypeSymbol geneticType)
513517 } ) ;
514518 }
515519
516- private bool TryCreateOnCannotResolve (
517- ICache < ProcessingNodeKey , IProcessingNode > nodesCache ,
518- MdSetup setup ,
520+ private bool TryCreateOnCannotResolve ( MdSetup setup ,
519521 ITypeConstructor typeConstructor ,
520522 DependencyNode ownerNode ,
521523 Injection unresolvedInjection ,
@@ -549,7 +551,7 @@ private bool TryCreateOnCannotResolve(
549551 foreach ( var onCannotResolveNode in onCannotResolveNodes )
550552 {
551553 map [ unresolvedInjection ] = onCannotResolveNode ;
552- processed . Add ( CreateNewProcessingNode ( nodesCache , unresolvedInjection . Tag , onCannotResolveNode ) ) ;
554+ processed . Add ( CreateNewProcessingNode ( unresolvedInjection . Tag , onCannotResolveNode ) ) ;
553555 return true ;
554556 }
555557 }
@@ -558,8 +560,8 @@ private bool TryCreateOnCannotResolve(
558560 return false ;
559561 }
560562
561- private IProcessingNode CreateNewProcessingNode ( ICache < ProcessingNodeKey , IProcessingNode > nodesCache , object ? contextTag , DependencyNode dependencyNode ) =>
562- processingNodeBuilder . Build ( new ProcessingNodeContext ( nodesCache , dependencyNode , contextTag ) ) ;
563+ private IProcessingNode CreateNewProcessingNode ( object ? contextTag , DependencyNode dependencyNode ) =>
564+ processingNodeBuilder . Build ( new ProcessingNodeContext ( dependencyNode , contextTag ) ) ;
563565
564566 private static object ? GetContextTag ( Injection injection , DependencyNode node ) =>
565567 node . Factory is { Source . HasContextTag : true } ? injection . Tag : null ;
0 commit comments