-
Notifications
You must be signed in to change notification settings - Fork 385
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
js share by reference formatted values #3032
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,51 +173,29 @@ private static async Task HandleSetMagicCommand<T>( | |
|
||
var valueOptionResult = cmdLineContext.ParseResult.GetValueForOption(valueOption); | ||
|
||
// FIX: (HandleSetMagicCommand) | ||
|
||
switch (events.Count) | ||
{ | ||
case 0: break; | ||
case 1: break; | ||
case 2: break; | ||
default: break; | ||
} | ||
|
||
if (valueOptionResult is { }) | ||
{ | ||
if (valueOptionResult.Kernel is { } sourceKernelName) | ||
{ | ||
switch (sourceKernelName) | ||
{ | ||
case "input": break; | ||
case "password": break; | ||
default: break; | ||
} | ||
} | ||
else | ||
{ | ||
} | ||
|
||
if (valueOptionResult.Kernel is { } sourceValueName) | ||
{ | ||
} | ||
else | ||
{ | ||
} | ||
var sourceKernel = Kernel.Root.FindKernelByName(valueOptionResult.Kernel); | ||
|
||
ValueProduced valueProduced; | ||
if ( | ||
sourceKernel?.KernelInfo.IsProxy == false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the kernel is not found. that is the case when using @input:x There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right. |
||
&& valueOptionResult is { Name: var sourceValueName, Kernel: var sourceKernelName } | ||
&& sourceKernelName != "input") | ||
{ | ||
valueProduced = events.SingleOrDefault(e => | ||
e.Name == sourceValueName && e.Command.TargetKernelName == sourceKernelName); | ||
}else if (sourceKernel?.KernelInfo.IsProxy == true | ||
&& valueOptionResult is { Name: var sourceValueName1 }) | ||
{ | ||
var destinationUri = sourceKernel?.KernelInfo.RemoteUri; | ||
|
||
valueProduced = events.SingleOrDefault(e => | ||
e.Name == sourceValueName1 && e.Command.DestinationUri == destinationUri); | ||
} | ||
else | ||
{ | ||
valueProduced = null; | ||
} | ||
|
||
var valueProduced = valueOptionResult switch | ||
{ | ||
{ Name: var sourceValueName, Kernel: var sourceKernelName } when | ||
// !string.IsNullOrWhiteSpace(sourceKernelName) && | ||
sourceKernelName != "input" => events.SingleOrDefault( | ||
e => e.Name == sourceValueName && e.Command.TargetKernelName == sourceKernelName), | ||
_ => null | ||
}; | ||
|
||
if (valueProduced is { }) | ||
{ | ||
var referenceValue = isByref ? valueProduced.Value : null; | ||
|
@@ -383,6 +361,8 @@ ValueOptionResult ParseValueOption(ArgumentResult argResult) | |
isByref = false; | ||
} | ||
|
||
var valueSourceKernel = destinationKernel.RootKernel.FindKernelByName(sourceValueName); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ops |
||
|
||
var result = destinationKernel.RootKernel.SendAsync(requestValue).GetAwaiter().GetResult(); | ||
|
||
if (result.Events.LastOrDefault() is CommandFailed failed) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test name should be more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
ProxyKernels_sharing_values_receives_them_as_deserialized_values