nushell/crates
Devyn Cairns 73f3c0b60b
Support for all custom value operations on plugin custom values (#12088)
# Description

Adds support for the following operations on plugin custom values, in
addition to `to_base_value` which was already present:

- `follow_path_int()`
- `follow_path_string()`
- `partial_cmp()`
- `operation()`
- `Drop` (notification, if opted into with
`CustomValue::notify_plugin_on_drop`)

There are additionally customizable methods within the `Plugin` and
`StreamingPlugin` traits for implementing these functions in a way that
requires access to the plugin state, as a registered handle model such
as might be used in a dataframes plugin would.

`Value::append` was also changed to handle custom values correctly.

# User-Facing Changes

- Signature of `CustomValue::follow_path_string` and
`CustomValue::follow_path_int` changed to give access to the span of the
custom value itself, useful for some errors.
- Plugins using custom values have to be recompiled because the engine
will try to do custom value operations that aren't supported
- Plugins can do more things 🎉 

# Tests + Formatting
Tests were added for all of the new custom values functionality.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
- [ ] Document protocol reference `CustomValueOp` variants:
  - [ ] `FollowPathInt`
  - [ ] `FollowPathString`
  - [ ] `PartialCmp`
  - [ ] `Operation`
  - [ ] `Dropped`
- [ ] Document `notify_on_drop` optional field in `PluginCustomValue`
2024-03-12 10:37:08 +01:00
..
nu_plugin_custom_values Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu_plugin_example Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06:00
nu_plugin_formats Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_gstat Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_inc Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_python Improve the error message for a plugin version mismatch (#12122) 2024-03-08 06:04:22 -06:00
nu_plugin_query Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_stream_example Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu-cli Canonicalize config dir (#12136) 2024-03-10 11:07:31 +01:00
nu-cmd-base Allow for stacks to have parents (#11654) 2024-03-09 17:55:39 +01:00
nu-cmd-dataframe Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-cmd-extra Remove feat extra and include in default (#12140) 2024-03-10 17:29:02 +01:00
nu-cmd-lang do command: Make closure support default parameters and type checking (#12056) 2024-03-11 18:11:08 +08:00
nu-color-config Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00
nu-command Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-engine Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-explore Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-glob Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-json remove repetitive word (#12117) 2024-03-08 15:29:20 +08:00
nu-lsp Introduce workspace dependencies (#12043) 2024-03-07 14:40:31 -08:00
nu-parser Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-path Use XDG_CONFIG_HOME before default config directory (#12118) 2024-03-11 06:15:46 -05:00
nu-plugin Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-pretty-hex Introduce workspace dependencies (#12043) 2024-03-07 14:40:31 -08:00
nu-protocol Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-std Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
nu-system Bump windows from 0.52.0 to 0.54.0 (#12037) 2024-03-07 16:36:28 -08:00
nu-table Introduce workspace dependencies (#12043) 2024-03-07 14:40:31 -08:00
nu-term-grid Bump version to 0.91.1 (#12085) 2024-03-06 23:08:14 +01:00
nu-test-support Update tests Playground (#12134) 2024-03-08 20:31:21 -08:00
nu-utils Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06:00
README.md

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.