diff --git a/crates/nu_plugin_nu_example/nu_plugin_nu_example.nu b/crates/nu_plugin_nu_example/nu_plugin_nu_example.nu index f5d90dc6c6..3bbf5b965c 100755 --- a/crates/nu_plugin_nu_example/nu_plugin_nu_example.nu +++ b/crates/nu_plugin_nu_example/nu_plugin_nu_example.nu @@ -7,7 +7,7 @@ # language without adding any extra dependencies to our tests. const NUSHELL_VERSION = "0.96.2" -const PLUGIN_VERSION = "0.1.0" # bump if you change commands! +const PLUGIN_VERSION = "0.1.1" # bump if you change commands! def main [--stdio] { if ($stdio) { @@ -133,7 +133,7 @@ def process_call [ # Create a Value of type List that will be encoded and sent to Nushell let value = { - Value: { value: { + Value: [{ List: { vals: (0..9 | each { |x| { @@ -157,8 +157,7 @@ def process_call [ }), span: $span } - } - } + }, null] } write_response $id { PipelineData: $value } diff --git a/crates/nu_plugin_python/nu_plugin_python_example.py b/crates/nu_plugin_python/nu_plugin_python_example.py index 5a0357e9ca..55d3204a34 100755 --- a/crates/nu_plugin_python/nu_plugin_python_example.py +++ b/crates/nu_plugin_python/nu_plugin_python_example.py @@ -28,7 +28,7 @@ import json NUSHELL_VERSION = "0.96.2" -PLUGIN_VERSION = "0.1.0" # bump if you change commands! +PLUGIN_VERSION = "0.1.1" # bump if you change commands! def signatures(): @@ -125,31 +125,31 @@ def process_call(id, plugin_call): span = plugin_call["call"]["head"] # Creates a Value of type List that will be encoded and sent to Nushell - def f(x, y): return { - "Int": { - "val": x * y, - "span": span - } - } + def f(x, y): + return {"Int": {"val": x * y, "span": span}} value = { - "Value": { - "List": { - "vals": [ - { - "Record": { - "val": { - "one": f(x, 0), - "two": f(x, 1), - "three": f(x, 2), - }, - "span": span + "Value": [ + { + "List": { + "vals": [ + { + "Record": { + "val": { + "one": f(x, 0), + "two": f(x, 1), + "three": f(x, 2), + }, + "span": span, + } } - } for x in range(0, 10) - ], - "span": span - } - } + for x in range(0, 10) + ], + "span": span, + } + }, + None, + ] } write_response(id, {"PipelineData": value}) @@ -172,7 +172,7 @@ def tell_nushell_hello(): "Hello": { "protocol": "nu-plugin", # always this value "version": NUSHELL_VERSION, - "features": [] + "features": [], } } sys.stdout.write(json.dumps(hello)) @@ -200,22 +200,26 @@ def write_error(id, text, span=None): Use this error format to send errors to nushell in response to a plugin call. The ID of the plugin call is required. """ - error = { - "Error": { - "msg": "ERROR from plugin", - "labels": [ - { - "text": text, - "span": span, - } - ], + error = ( + { + "Error": { + "msg": "ERROR from plugin", + "labels": [ + { + "text": text, + "span": span, + } + ], + } } - } if span is not None else { - "Error": { - "msg": "ERROR from plugin", - "help": text, + if span is not None + else { + "Error": { + "msg": "ERROR from plugin", + "help": text, + } } - } + ) write_response(id, error) @@ -230,11 +234,14 @@ def handle_input(input): elif "Call" in input: [id, plugin_call] = input["Call"] if plugin_call == "Metadata": - write_response(id, { - "Metadata": { - "version": PLUGIN_VERSION, - } - }) + write_response( + id, + { + "Metadata": { + "version": PLUGIN_VERSION, + } + }, + ) elif plugin_call == "Signature": write_response(id, signatures()) elif "Run" in plugin_call: @@ -258,4 +265,4 @@ if __name__ == "__main__": if len(sys.argv) == 2 and sys.argv[1] == "--stdio": plugin() else: - print("Run me from inside nushell!") \ No newline at end of file + print("Run me from inside nushell!") diff --git a/crates/nu_plugin_stress_internals/src/main.rs b/crates/nu_plugin_stress_internals/src/main.rs index d9a3940815..8bc4631637 100644 --- a/crates/nu_plugin_stress_internals/src/main.rs +++ b/crates/nu_plugin_stress_internals/src/main.rs @@ -178,7 +178,7 @@ fn handle_message( id, { "PipelineData": { - "Value": {"value": return_value} + "Value": [return_value, None::] } } ]