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

handle multiple #!set commands in sungle submission #2960

Merged
merged 1 commit into from
May 2, 2023

Conversation

colombod
Copy link
Member

@colombod colombod commented May 2, 2023

image


var valueProduced = events.SingleOrDefault();
var valueProduced = valueSource switch
{ { Name: var sourceValueName, Kernel: var sourceKernelName } when !string.IsNullOrWhiteSpace(sourceKernelName) && !string.IsNullOrEmpty(sourceKernelName) && sourceKernelName != "input" => events.SingleOrDefault(e => e.Name == sourceValueName && e.Command.TargetKernelName == sourceKernelName),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to split the long line...

{
var valueOptionValue = argResult.Tokens.Single().Value;

if (!valueOptionValue.StartsWith("@"))
{
return valueOptionValue;
return new ValueOptionResult( valueOptionValue, null,null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using named params for the nulls

}
}
else
{
context.Fail(context.Command, new CommandNotSupportedException(typeof(SendValue), kernel));
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: Remove blank lines

@colombod colombod merged commit 3fc4a4f into dotnet:main May 2, 2023
@colombod colombod deleted the fix_set branch May 2, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Variable sharing bug Something isn't working
Projects
None yet
2 participants