forked from extern/nushell
05ff7a9925
This should close #8567. # Description this PR throws an error when `start > end` in the most complete branch of `ErrorMake::run`, i.e. when `$.msg`, `$.label.text`, `$.label.start` and `$.label.end` are defined. i've also added a `error_start_bigger_than_end_should_fail` test to check that it does indeed return the right error. # User-Facing Changes no more crash when manipulating span bounds and a clear error, e.g. ```bash >_ error make {msg: "msg" label: {text: "text" start: 1010 end: 1000}} Error: × invalid error format. ╭─[entry #3:1:1] 1 │ error make {msg: "msg" label: {text: "text" start: 1010 end: 1000}} · ──────────────────┬───────────────── · ╰── `$.label.start` is stricly bigger than `$.label.end` ╰──── help: 1010 > 1000 ``` or ```bash >_ error make { ::: msg: "msg" ::: label: { ::: text: "text" ::: start: ($nu.scope.engine_state.source_bytes - 90) ::: end: ($nu.scope.engine_state.source_bytes - 100) ::: } ::: } Error: × invalid error format. ╭─[entry #4:2:1] 2 │ msg: "msg" 3 │ ╭─▶ label: { 4 │ │ text: "text" 5 │ │ start: ($nu.scope.engine_state.source_bytes - 90) 6 │ │ end: ($nu.scope.engine_state.source_bytes - 100) 7 │ ├─▶ } · ╰──── `$.label.start` is stricly bigger than `$.label.end` 8 │ } ╰──── help: 204525 > 204515 ``` # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🔴 `toolkit test` # After Submitting ``` $nothing ``` |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu-cli | ||
nu-cmd-lang | ||
nu-color-config | ||
nu-command | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
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.