Skip to content

Commit

Permalink
Merge pull request #1751 from glopesdev/issue-1742
Browse files Browse the repository at this point in the history
Preserve visualizer types across nested sink nodes
  • Loading branch information
glopesdev authored Apr 23, 2024
2 parents 2add137 + b17da46 commit bbfe0cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Bonsai.Core/Expressions/InspectBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ internal static InspectBuilder GetInspectBuilder(Expression source)
if (methodCall.Method.DeclaringType == typeof(ExpressionBuilder))
{
// If merging dangling branches in a workflow, recurse on the main output source
if (methodCall.Method.Name == nameof(ExpressionBuilder.MergeOutput))
if (methodCall.Method.Name == nameof(MergeOutput))
{
source = methodCall.Arguments[0];
}
// If merging with build dependencies in a workflow, recurse on the main output
else if (methodCall.Method.Name == nameof(ExpressionBuilder.MergeDependencies) &&
else if (methodCall.Method.Name == nameof(MergeDependencies) &&
methodCall.Arguments[0] is MethodCallExpression lazy &&
lazy.Arguments[0] is LambdaExpression lambda)
{
Expand All @@ -209,9 +209,10 @@ methodCall.Arguments[0] is MethodCallExpression lazy &&
{
source = methodCall.Arguments[0];
}
// If multicasting into a subject, recurse on the input source
// If multicasting into a subject or nested sink, recurse on the input source
else if ((methodCall.Method.DeclaringType == typeof(SubjectBuilder) ||
methodCall.Method.DeclaringType == typeof(MulticastSubject)) &&
methodCall.Method.DeclaringType == typeof(MulticastSubject) ||
methodCall.Method.DeclaringType == typeof(Reactive.Sink)) &&
methodCall.Method.Name == nameof(Combinator.Process))
{
source = methodCall.Arguments[0];
Expand Down

0 comments on commit bbfe0cf

Please sign in to comment.