mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 00:38:23 +01:00
add missing shapes to default_config (#7472)
# Description We've added some shapes recently. This PR adds them to the default_config and sorts them in order to make finding missing ones easier. # User-Facing Changes # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
parent
52278f8562
commit
0db4d89838
@ -9,36 +9,36 @@ pub fn get_shape_color(shape: String, conf: &Config) -> Style {
|
|||||||
Err(_) => Style::default(),
|
Err(_) => Style::default(),
|
||||||
},
|
},
|
||||||
None => match shape.as_ref() {
|
None => match shape.as_ref() {
|
||||||
"shape_garbage" => Style::new().fg(Color::White).on(Color::Red).bold(),
|
"shape_and" => Style::new().fg(Color::Purple).bold(),
|
||||||
"shape_binary" => Style::new().fg(Color::Purple).bold(),
|
"shape_binary" => Style::new().fg(Color::Purple).bold(),
|
||||||
|
"shape_block" => Style::new().fg(Color::Blue).bold(),
|
||||||
"shape_bool" => Style::new().fg(Color::LightCyan),
|
"shape_bool" => Style::new().fg(Color::LightCyan),
|
||||||
"shape_int" => Style::new().fg(Color::Purple).bold(),
|
"shape_custom" => Style::new().fg(Color::Green),
|
||||||
"shape_float" => Style::new().fg(Color::Purple).bold(),
|
"shape_datetime" => Style::new().fg(Color::Cyan).bold(),
|
||||||
"shape_range" => Style::new().fg(Color::Yellow).bold(),
|
"shape_directory" => Style::new().fg(Color::Cyan),
|
||||||
"shape_internalcall" => Style::new().fg(Color::Cyan).bold(),
|
|
||||||
"shape_external" => Style::new().fg(Color::Cyan),
|
"shape_external" => Style::new().fg(Color::Cyan),
|
||||||
"shape_externalarg" => Style::new().fg(Color::Green).bold(),
|
"shape_externalarg" => Style::new().fg(Color::Green).bold(),
|
||||||
|
"shape_filepath" => Style::new().fg(Color::Cyan),
|
||||||
|
"shape_flag" => Style::new().fg(Color::Blue).bold(),
|
||||||
|
"shape_float" => Style::new().fg(Color::Purple).bold(),
|
||||||
|
"shape_garbage" => Style::new().fg(Color::White).on(Color::Red).bold(),
|
||||||
|
"shape_globpattern" => Style::new().fg(Color::Cyan).bold(),
|
||||||
|
"shape_int" => Style::new().fg(Color::Purple).bold(),
|
||||||
|
"shape_internalcall" => Style::new().fg(Color::Cyan).bold(),
|
||||||
|
"shape_list" => Style::new().fg(Color::Cyan).bold(),
|
||||||
"shape_literal" => Style::new().fg(Color::Blue),
|
"shape_literal" => Style::new().fg(Color::Blue),
|
||||||
|
"shape_nothing" => Style::new().fg(Color::LightCyan),
|
||||||
"shape_operator" => Style::new().fg(Color::Yellow),
|
"shape_operator" => Style::new().fg(Color::Yellow),
|
||||||
|
"shape_or" => Style::new().fg(Color::Purple).bold(),
|
||||||
|
"shape_pipe" => Style::new().fg(Color::Purple).bold(),
|
||||||
|
"shape_range" => Style::new().fg(Color::Yellow).bold(),
|
||||||
|
"shape_record" => Style::new().fg(Color::Cyan).bold(),
|
||||||
|
"shape_redirection" => Style::new().fg(Color::Purple).bold(),
|
||||||
"shape_signature" => Style::new().fg(Color::Green).bold(),
|
"shape_signature" => Style::new().fg(Color::Green).bold(),
|
||||||
"shape_string" => Style::new().fg(Color::Green),
|
"shape_string" => Style::new().fg(Color::Green),
|
||||||
"shape_string_interpolation" => Style::new().fg(Color::Cyan).bold(),
|
"shape_string_interpolation" => Style::new().fg(Color::Cyan).bold(),
|
||||||
"shape_datetime" => Style::new().fg(Color::Cyan).bold(),
|
|
||||||
"shape_list" => Style::new().fg(Color::Cyan).bold(),
|
|
||||||
"shape_table" => Style::new().fg(Color::Blue).bold(),
|
"shape_table" => Style::new().fg(Color::Blue).bold(),
|
||||||
"shape_record" => Style::new().fg(Color::Cyan).bold(),
|
|
||||||
"shape_block" => Style::new().fg(Color::Blue).bold(),
|
|
||||||
"shape_filepath" => Style::new().fg(Color::Cyan),
|
|
||||||
"shape_directory" => Style::new().fg(Color::Cyan),
|
|
||||||
"shape_globpattern" => Style::new().fg(Color::Cyan).bold(),
|
|
||||||
"shape_variable" => Style::new().fg(Color::Purple),
|
"shape_variable" => Style::new().fg(Color::Purple),
|
||||||
"shape_flag" => Style::new().fg(Color::Blue).bold(),
|
|
||||||
"shape_custom" => Style::new().fg(Color::Green),
|
|
||||||
"shape_pipe" => Style::new().fg(Color::Purple).bold(),
|
|
||||||
"shape_redirection" => Style::new().fg(Color::Purple).bold(),
|
|
||||||
"shape_and" => Style::new().fg(Color::Purple).bold(),
|
|
||||||
"shape_or" => Style::new().fg(Color::Purple).bold(),
|
|
||||||
"shape_nothing" => Style::new().fg(Color::LightCyan),
|
|
||||||
_ => Style::default(),
|
_ => Style::default(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -7,71 +7,71 @@ use std::fmt::{Display, Formatter, Result};
|
|||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq, Ord, Clone, PartialOrd)]
|
#[derive(Debug, Eq, PartialEq, Ord, Clone, PartialOrd)]
|
||||||
pub enum FlatShape {
|
pub enum FlatShape {
|
||||||
Garbage,
|
And,
|
||||||
Nothing,
|
|
||||||
Bool,
|
|
||||||
Binary,
|
Binary,
|
||||||
Int,
|
Block,
|
||||||
Float,
|
Bool,
|
||||||
Range,
|
Custom(DeclId),
|
||||||
InternalCall,
|
DateTime,
|
||||||
|
Directory,
|
||||||
External,
|
External,
|
||||||
ExternalArg,
|
ExternalArg,
|
||||||
|
Filepath,
|
||||||
|
Flag,
|
||||||
|
Float,
|
||||||
|
Garbage,
|
||||||
|
GlobPattern,
|
||||||
|
Int,
|
||||||
|
InternalCall,
|
||||||
|
List,
|
||||||
Literal,
|
Literal,
|
||||||
|
Nothing,
|
||||||
Operator,
|
Operator,
|
||||||
|
Or,
|
||||||
|
Pipe,
|
||||||
|
Range,
|
||||||
|
Record,
|
||||||
|
Redirection,
|
||||||
Signature,
|
Signature,
|
||||||
String,
|
String,
|
||||||
StringInterpolation,
|
StringInterpolation,
|
||||||
List,
|
|
||||||
Table,
|
Table,
|
||||||
Record,
|
|
||||||
Block,
|
|
||||||
Filepath,
|
|
||||||
Directory,
|
|
||||||
DateTime,
|
|
||||||
GlobPattern,
|
|
||||||
Variable,
|
Variable,
|
||||||
Flag,
|
|
||||||
Pipe,
|
|
||||||
And,
|
|
||||||
Or,
|
|
||||||
Redirection,
|
|
||||||
Custom(DeclId),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for FlatShape {
|
impl Display for FlatShape {
|
||||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||||
match self {
|
match self {
|
||||||
FlatShape::Garbage => write!(f, "shape_garbage"),
|
FlatShape::And => write!(f, "shape_and"),
|
||||||
FlatShape::Nothing => write!(f, "shape_nothing"),
|
|
||||||
FlatShape::Binary => write!(f, "shape_binary"),
|
FlatShape::Binary => write!(f, "shape_binary"),
|
||||||
|
FlatShape::Block => write!(f, "shape_block"),
|
||||||
FlatShape::Bool => write!(f, "shape_bool"),
|
FlatShape::Bool => write!(f, "shape_bool"),
|
||||||
FlatShape::Int => write!(f, "shape_int"),
|
FlatShape::Custom(_) => write!(f, "shape_custom"),
|
||||||
FlatShape::Float => write!(f, "shape_float"),
|
FlatShape::DateTime => write!(f, "shape_datetime"),
|
||||||
FlatShape::Range => write!(f, "shape_range"),
|
FlatShape::Directory => write!(f, "shape_directory"),
|
||||||
FlatShape::InternalCall => write!(f, "shape_internalcall"),
|
|
||||||
FlatShape::External => write!(f, "shape_external"),
|
FlatShape::External => write!(f, "shape_external"),
|
||||||
FlatShape::ExternalArg => write!(f, "shape_externalarg"),
|
FlatShape::ExternalArg => write!(f, "shape_externalarg"),
|
||||||
|
FlatShape::Filepath => write!(f, "shape_filepath"),
|
||||||
|
FlatShape::Flag => write!(f, "shape_flag"),
|
||||||
|
FlatShape::Float => write!(f, "shape_float"),
|
||||||
|
FlatShape::Garbage => write!(f, "shape_garbage"),
|
||||||
|
FlatShape::GlobPattern => write!(f, "shape_globpattern"),
|
||||||
|
FlatShape::Int => write!(f, "shape_int"),
|
||||||
|
FlatShape::InternalCall => write!(f, "shape_internalcall"),
|
||||||
|
FlatShape::List => write!(f, "shape_list"),
|
||||||
FlatShape::Literal => write!(f, "shape_literal"),
|
FlatShape::Literal => write!(f, "shape_literal"),
|
||||||
|
FlatShape::Nothing => write!(f, "shape_nothing"),
|
||||||
FlatShape::Operator => write!(f, "shape_operator"),
|
FlatShape::Operator => write!(f, "shape_operator"),
|
||||||
|
FlatShape::Or => write!(f, "shape_or"),
|
||||||
|
FlatShape::Pipe => write!(f, "shape_pipe"),
|
||||||
|
FlatShape::Range => write!(f, "shape_range"),
|
||||||
|
FlatShape::Record => write!(f, "shape_record"),
|
||||||
|
FlatShape::Redirection => write!(f, "shape_redirection"),
|
||||||
FlatShape::Signature => write!(f, "shape_signature"),
|
FlatShape::Signature => write!(f, "shape_signature"),
|
||||||
FlatShape::String => write!(f, "shape_string"),
|
FlatShape::String => write!(f, "shape_string"),
|
||||||
FlatShape::DateTime => write!(f, "shape_datetime"),
|
|
||||||
FlatShape::StringInterpolation => write!(f, "shape_string_interpolation"),
|
FlatShape::StringInterpolation => write!(f, "shape_string_interpolation"),
|
||||||
FlatShape::List => write!(f, "shape_list"),
|
|
||||||
FlatShape::Table => write!(f, "shape_table"),
|
FlatShape::Table => write!(f, "shape_table"),
|
||||||
FlatShape::Record => write!(f, "shape_record"),
|
|
||||||
FlatShape::Block => write!(f, "shape_block"),
|
|
||||||
FlatShape::Filepath => write!(f, "shape_filepath"),
|
|
||||||
FlatShape::Directory => write!(f, "shape_directory"),
|
|
||||||
FlatShape::GlobPattern => write!(f, "shape_globpattern"),
|
|
||||||
FlatShape::Variable => write!(f, "shape_variable"),
|
FlatShape::Variable => write!(f, "shape_variable"),
|
||||||
FlatShape::Flag => write!(f, "shape_flag"),
|
|
||||||
FlatShape::Pipe => write!(f, "shape_pipe"),
|
|
||||||
FlatShape::And => write!(f, "shape_and"),
|
|
||||||
FlatShape::Or => write!(f, "shape_or"),
|
|
||||||
FlatShape::Redirection => write!(f, "shape_redirection"),
|
|
||||||
FlatShape::Custom(_) => write!(f, "shape_custom"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,34 +152,38 @@ let dark_theme = {
|
|||||||
block: white
|
block: white
|
||||||
hints: dark_gray
|
hints: dark_gray
|
||||||
|
|
||||||
# shapes are used to change the cli syntax highlighting
|
shape_and: purple_bold
|
||||||
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
|
|
||||||
shape_binary: purple_bold
|
shape_binary: purple_bold
|
||||||
|
shape_block: blue_bold
|
||||||
shape_bool: light_cyan
|
shape_bool: light_cyan
|
||||||
shape_int: purple_bold
|
shape_custom: green
|
||||||
shape_float: purple_bold
|
shape_datetime: cyan_bold
|
||||||
shape_range: yellow_bold
|
shape_directory: cyan
|
||||||
shape_internalcall: cyan_bold
|
|
||||||
shape_external: cyan
|
shape_external: cyan
|
||||||
shape_externalarg: green_bold
|
shape_externalarg: green_bold
|
||||||
|
shape_filepath: cyan
|
||||||
|
shape_flag: blue_bold
|
||||||
|
shape_float: purple_bold
|
||||||
|
# shapes are used to change the cli syntax highlighting
|
||||||
|
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
|
||||||
|
shape_globpattern: cyan_bold
|
||||||
|
shape_int: purple_bold
|
||||||
|
shape_internalcall: cyan_bold
|
||||||
|
shape_list: cyan_bold
|
||||||
shape_literal: blue
|
shape_literal: blue
|
||||||
|
shape_matching_brackets: { attr: u }
|
||||||
|
shape_nothing: light_cyan
|
||||||
shape_operator: yellow
|
shape_operator: yellow
|
||||||
|
shape_or: purple_bold
|
||||||
|
shape_pipe: purple_bold
|
||||||
|
shape_range: yellow_bold
|
||||||
|
shape_record: cyan_bold
|
||||||
|
shape_redirection: purple_bold
|
||||||
shape_signature: green_bold
|
shape_signature: green_bold
|
||||||
shape_string: green
|
shape_string: green
|
||||||
shape_string_interpolation: cyan_bold
|
shape_string_interpolation: cyan_bold
|
||||||
shape_datetime: cyan_bold
|
|
||||||
shape_list: cyan_bold
|
|
||||||
shape_table: blue_bold
|
shape_table: blue_bold
|
||||||
shape_record: cyan_bold
|
|
||||||
shape_block: blue_bold
|
|
||||||
shape_filepath: cyan
|
|
||||||
shape_directory: cyan
|
|
||||||
shape_globpattern: cyan_bold
|
|
||||||
shape_variable: purple
|
shape_variable: purple
|
||||||
shape_flag: blue_bold
|
|
||||||
shape_custom: green
|
|
||||||
shape_nothing: light_cyan
|
|
||||||
shape_matching_brackets: { attr: u }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let light_theme = {
|
let light_theme = {
|
||||||
@ -205,34 +209,38 @@ let light_theme = {
|
|||||||
block: white
|
block: white
|
||||||
hints: dark_gray
|
hints: dark_gray
|
||||||
|
|
||||||
# shapes are used to change the cli syntax highlighting
|
shape_and: purple_bold
|
||||||
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
|
|
||||||
shape_binary: purple_bold
|
shape_binary: purple_bold
|
||||||
|
shape_block: blue_bold
|
||||||
shape_bool: light_cyan
|
shape_bool: light_cyan
|
||||||
shape_int: purple_bold
|
shape_custom: green
|
||||||
shape_float: purple_bold
|
shape_datetime: cyan_bold
|
||||||
shape_range: yellow_bold
|
shape_directory: cyan
|
||||||
shape_internalcall: cyan_bold
|
|
||||||
shape_external: cyan
|
shape_external: cyan
|
||||||
shape_externalarg: green_bold
|
shape_externalarg: green_bold
|
||||||
|
shape_filepath: cyan
|
||||||
|
shape_flag: blue_bold
|
||||||
|
shape_float: purple_bold
|
||||||
|
# shapes are used to change the cli syntax highlighting
|
||||||
|
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
|
||||||
|
shape_globpattern: cyan_bold
|
||||||
|
shape_int: purple_bold
|
||||||
|
shape_internalcall: cyan_bold
|
||||||
|
shape_list: cyan_bold
|
||||||
shape_literal: blue
|
shape_literal: blue
|
||||||
|
shape_matching_brackets: { attr: u }
|
||||||
|
shape_nothing: light_cyan
|
||||||
shape_operator: yellow
|
shape_operator: yellow
|
||||||
|
shape_or: purple_bold
|
||||||
|
shape_pipe: purple_bold
|
||||||
|
shape_range: yellow_bold
|
||||||
|
shape_record: cyan_bold
|
||||||
|
shape_redirection: purple_bold
|
||||||
shape_signature: green_bold
|
shape_signature: green_bold
|
||||||
shape_string: green
|
shape_string: green
|
||||||
shape_string_interpolation: cyan_bold
|
shape_string_interpolation: cyan_bold
|
||||||
shape_datetime: cyan_bold
|
|
||||||
shape_list: cyan_bold
|
|
||||||
shape_table: blue_bold
|
shape_table: blue_bold
|
||||||
shape_record: cyan_bold
|
|
||||||
shape_block: blue_bold
|
|
||||||
shape_filepath: cyan
|
|
||||||
shape_directory: cyan
|
|
||||||
shape_globpattern: cyan_bold
|
|
||||||
shape_variable: purple
|
shape_variable: purple
|
||||||
shape_flag: blue_bold
|
|
||||||
shape_custom: green
|
|
||||||
shape_nothing: light_cyan
|
|
||||||
shape_matching_brackets: { attr: u }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# External completer example
|
# External completer example
|
||||||
|
Loading…
Reference in New Issue
Block a user