Repository: nushell/nushell
File: crates/nu-cli/src/repl.rs (Rust)

Code before:
            // STACK-REFERENCE 2
            stack_arc.clone(),
        )))
        .with_quick_completions(config.completions.quick)
        .with_partial_completions(config.completions.partial)
        .with_ansi_colors(config.use_ansi_coloring.get(engine_state))
        .with_cwd(Some(
            engine_state
                .cwd(None)
                .map(|cwd| cwd.into_std_path_buf())
                .unwrap_or_default()
                .to_string_lossy()
                .to_string(),
        ))
        .with_cursor_config(cursor_config)
        .with_visual_selection_style(nu_ansi_term::Style {
            is_reverse: true,
            ..Default::default()
        });

    perf!("reedline builder", start_time, use_color);

    let style_computer = StyleComputer::from_config(engine_state, &stack_arc);

    start_time = std::time::Instant::now();
    line_editor = if config.use_ansi_coloring.get(engine_state) {
        line_editor.with_hinter(Box::new({
            // As of Nov 2022, "hints" color_config closures only get `null` passed in.
            let style = style_computer.compute("hints", &Value::nothing(Span::unknown()));
            CwdAwareHinter::default().with_style(style)
        }))
    } else {
        line_editor.disable_hints()
    };

    perf!("reedline coloring/style_computer", start_time, use_color);

    start_time = std::time::Instant::now();
    trace!("adding menus");
    line_editor =
        add_menus(line_editor, engine_reference, &stack_arc, config).unwrap_or_else(|e| {
            report_shell_error(None, engine_state, &e);
            Reedline::create()
        });

    perf!("reedline adding menus", start_time, use_color);

    start_time = std::time::Instant::now();
    let buffer_editor = get_editor(engine_state, &stack_arc, Span::unknown());

    line_editor = if let Ok((cmd, args)) = buffer_editor {

Review comment (suggestion):
I guess whether hints are shown depends on more than just the value of `show_hints`; perhaps it should be a `disable_hints` option instead. Alternatively, the documentation could say something along the lines of: show hints (if supported).

Code after:
            // STACK-REFERENCE 2
            stack_arc.clone(),
        )))
        .with_quick_completions(config.completions.quick)
        .with_partial_completions(config.completions.partial)
        .with_ansi_colors(config.use_ansi_coloring.get(engine_state))
        .with_cwd(Some(
            engine_state
                .cwd(None)
                .map(|cwd| cwd.into_std_path_buf())
                .unwrap_or_default()
                .to_string_lossy()
                .to_string(),
        ))
        .with_cursor_config(cursor_config)
        .with_visual_selection_style(nu_ansi_term::Style {
            is_reverse: true,
            ..Default::default()
        });

    perf!("reedline builder", start_time, use_color);

    let style_computer = StyleComputer::from_config(engine_state, &stack_arc);

    start_time = std::time::Instant::now();
    line_editor = if config.use_ansi_coloring.get(engine_state) && config.show_hints {
        line_editor.with_hinter(Box::new({
            // As of Nov 2022, "hints" color_config closures only get `null` passed in.
            let style = style_computer.compute("hints", &Value::nothing(Span::unknown()));
            CwdAwareHinter::default().with_style(style)
        }))
    } else {
        line_editor.disable_hints()
    };

    perf!("reedline coloring/style_computer", start_time, use_color);

    start_time = std::time::Instant::now();
    trace!("adding menus");
    line_editor =
        add_menus(line_editor, engine_reference, &stack_arc, config).unwrap_or_else(|e| {
            report_shell_error(None, engine_state, &e);
            Reedline::create()
        });

    perf!("reedline adding menus", start_time, use_color);

    start_time = std::time::Instant::now();
    let buffer_editor = get_editor(engine_state, &stack_arc, Span::unknown());

    line_editor = if let Ok((cmd, args)) = buffer_editor {