nushell/crates
Hristo Filaretov 0a990ed105
Simplify known external name recovery (#5213)
Prior to this change we would recover the names for known
externals by looking up the span in the engine state. This would fail
when using an alias for two reasons:

1. In cases where we don't have a subcommand, like this:

```
>>> extern bat [filename: string]
>>> alias b = bat
>>> bat some_file
'b' is not recognized as an internal or external command,
operable program or batch file.
```

The problem is that after alias expansion, we replace the span of the
expanded name with the original alias (this is done to alleviate
non-related issues). The span contents we look up therefore contain `b`,
the alias, instead of the expanded command name.

2. In cases where there's a subcommand:
```
>>> alias g = git
>>> g push
thread 'main' panicked at 'internal error: span missing in file contents cache', crates\nu-protocol\src\engine\engine_state.rs:474:9
note: run with `RUST_BACKTRACE=1` environment variable to display a
backtrace
```

In this case, the span in call starts where the expansion for the `g`
alias is defined and end after `push` on the last command entered. This
is not a proper span and causes a panic when we try to look it up. Note
that this is the case for all expanded aliases that involve a
subcommand, but we never actually try to retrieve the contents for that
span in other cases.

Anyway, the new way of looking up the name is arguably cleaner
regardless of the issues mentioned above. But it's nice that it fixes
them too.

Co-authored-by: Hristo Filaretov <h.filaretov@protonmail.com>
2022-04-16 22:07:38 -05:00
..
nu-cli Shell Integration (#5162) 2022-04-16 22:03:02 -05:00
nu-color-config Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-command [ls, path relative-to] Fix use of ls ~ | path relative-to ~ (#5212) 2022-04-16 15:05:42 -05:00
nu-engine Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-glob Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-json Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-parser Simplify known external name recovery (#5213) 2022-04-16 22:07:38 -05:00
nu-path [ls, path relative-to] Fix use of ls ~ | path relative-to ~ (#5212) 2022-04-16 15:05:42 -05:00
nu-plugin Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-pretty-hex Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-protocol Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-system Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-table Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-term-grid Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-test-support Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu-utils Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu_plugin_example Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu_plugin_gstat Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu_plugin_inc Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
nu_plugin_python Fix Python plugin (missing search terms) (#5083) 2022-04-03 20:00:53 -05:00
nu_plugin_query Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
old Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12: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.