-
Notifications
You must be signed in to change notification settings - Fork 381
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
Introduce #!set
magic command
#2654
Conversation
Additional test cases we'll want:
|
@@ -208,6 +209,194 @@ public static T UseLogMagicCommand<T>(this T kernel) | |||
return kernel; | |||
} | |||
|
|||
public static T UseSet<T>(this T kernel) where T : Kernel |
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.
public static T UseSet<T>(this T kernel) where T : Kernel | |
public static T UseSetMagicCommand<T>(this T kernel) where T : Kernel |
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 naming would be more informative and consistent but on second thought, I think this functionality should just be part of UseValueSharing
. It's the same core functionality and there's no use case for enabling one and not the other.
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.
Just moved this as part of turning on ValueSharing, refactored some code to become reused (sendValue for example)
} | ||
} | ||
|
||
private static void HandleSetMagicCommand<T>( |
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 method should be leveraging and/or refactoring the existing GetValueAndSendTo
method.
#!share --from csharp x
should be the same code path (after interpolation is done) as #!set --name x --value @csharp:x
.
I think we should overwrite, same is already happening with running #!share. users will want to be able to refresh imported values. |
|
||
set.SetHandler(cmdLineContext => | ||
{ | ||
HandleSetMagicCommand(kernel, cmdLineContext, fromResultOption, nameOption, fromValueOption, mimeTypeOption); |
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.
Since this is also being used by #!share
, a more generalized name for HandleSetMagicCommand
would be clearer.
Implements #2652.