nushell/crates/nu-parser/src
Ian Manske cc9f41e553
Use CommandType in more places (#12832)
# Description
Kind of a vague title, but this PR does two main things:
1. Rather than overriding functions like `Command::is_parser_keyword`,
this PR instead changes commands to override `Command::command_type`.
The `CommandType` returned by `Command::command_type` is then used to
automatically determine whether `Command::is_parser_keyword` and the
other `is_{type}` functions should return true. These changes allow us
to remove the `CommandType::Other` case and should also guarantee than
only one of the `is_{type}` functions on `Command` will return true.
2. Uses the new, reworked `Command::command_type` function in the `scope
commands` and `which` commands.


# User-Facing Changes
- Breaking change for `scope commands`: multiple columns (`is_builtin`,
`is_keyword`, `is_plugin`, etc.) have been merged into the `type`
column.
- Breaking change: the `which` command can now report `plugin` or
`keyword` instead of `built-in` in the `type` column. It may also now
report `external` instead of `custom` in the `type` column for known
`extern`s.
2024-05-18 23:37:31 +00:00
..
deparse.rs update deps calamine and quick-xml (#11582) 2024-01-19 12:23:51 -06:00
exportable.rs Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00
flatten.rs Fix syntax highlighting for not (#12815) 2024-05-10 07:09:44 +08:00
known_external.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
lex.rs make better messages for incomplete string (#12868) 2024-05-15 01:14:11 +00:00
lib.rs IO and redirection overhaul (#11934) 2024-03-14 15:51:55 -05:00
lite_parser.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parse_keywords.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
parse_patterns.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parse_shape_specs.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
parser_path.rs Deprecate register and add plugin use (#12607) 2024-04-23 06:37:50 -05:00
parser.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
type_check.rs Shrink the size of Expr (#12610) 2024-04-24 15:46:35 +00:00