nushell/crates
Ian Manske fa5d7babb9
Fix replacement closures for update, insert, and upsert (#11258)
# Description
This PR addresses #11204 which points out that using a closure for the
replacement value with `update`, `insert`, or `upsert` does not work for
lists.

# User-Facing Changes
- Replacement closures should now work for lists in `upsert`, `insert`,
and `update`. E.g., `[0] | update 0 {|i| $i + 1 }` now gives `[1]`
instead of an unhelpful error.
- `[1 2] | insert 4 20` no longer works. Before, this would give `[1, 2,
null, null, 20]`, but now it gives an error. This was done to match the
intended behavior in `Value::insert_data_at_cell_path`, whereas the
behavior before was probably unintentional. Following
`Value::insert_data_at_cell_path`, inserting at the end of a list is
also fine, so the valid indices for `upsert` and `insert` are
`0..=length` just like `Vec::insert` or list inserts in other languages.

# Tests + Formatting
Added tests for `upsert`, `insert`, and `update`:
- Replacement closures for lists, list streams, records, and tables
- Other list stream tests
2023-12-09 15:22:45 -06:00
..
nu_plugin_custom_values Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu_plugin_example Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu_plugin_formats Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu_plugin_gstat Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu_plugin_inc Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu_plugin_python remove vectorize_over_list from python plugin (#9905) 2023-08-03 16:46:48 +02:00
nu_plugin_query Move more commands to opaque Record type (#11122) 2023-11-22 23:48:48 +01:00
nu-cli Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-cmd-base Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-cmd-dataframe Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-cmd-extra Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-cmd-lang Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-color-config add shape ExternalResolved to show found externals via syntax highlighting in the repl (#11135) 2023-11-25 09:42:05 -06:00
nu-command Fix replacement closures for update, insert, and upsert (#11258) 2023-12-09 15:22:45 -06:00
nu-engine Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-explore Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-glob Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu-json Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu-lsp 🐛 Fixes markdown formatting on LSP hover (#11253) 2023-12-08 12:30:13 -06:00
nu-parser Match ++= capabilities with ++ (#11130) 2023-12-07 05:46:37 +08:00
nu-path Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu-plugin Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-pretty-hex Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu-protocol Fix replacement closures for update, insert, and upsert (#11258) 2023-12-09 15:22:45 -06:00
nu-std fix nu-std README (#11244) 2023-12-06 16:26:02 +01:00
nu-system Bump procfs to 0.16.0 (#11115) 2023-11-20 21:22:35 +01:00
nu-table Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu-term-grid Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu-test-support Bump version to 0.87.2 (#11114) 2023-11-20 20:31:10 +01:00
nu-utils Add nu lib dirs default (#11248) 2023-12-07 08:13:50 -06:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

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.