mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +01:00
00b3a07efe
# Description This allows plugins to view the source code of spans. Requested by @ayax79 for implementing `polars ls`. Note that this won't really help you find the location of the span. I'm planning to add another engine call that will return information more similar to what shows up in the miette diagnostics, with filename / line number / some context, but I'll want to refactor some of the existing logic to make that happen, so it was easier to just do this first. I hope this is enough to at least have something somewhat useful show up for `polars ls`. # User-Facing Changes - Example plugin: added `example view span` command # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting - [ ] Add to plugin protocol reference |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
Plugin Example
Crate with a simple example of the Plugin trait that needs to be implemented in order to create a binary that can be registered into nushell declaration list
example config
This subcommand demonstrates sending configuration from the nushell $env.config
to a plugin.
To register from after building nushell
run:
register target/debug/nu_plugin_example
The configuration for the plugin lives in $env.config.plugins.example
:
$env.config = {
plugins: {
example: [
some
values
]
}
}
To list plugin values run:
example config