Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve visualizer types across nested sink nodes #1751

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading