Skip to content

Disable inlay type hints by default or at least for when skipping rustfmt? #6674

Closed
@huntc

Description

@huntc

Would it be reasonable to see the inlay type hints disabled by default? I find that the same information is provided when hovering over a variable.

Also, for my particular use-case, I use #[rustfmt::skip] for some code sections and the inlay type hints destroy the desired formatting. If disabling by default is unpalatable, not having inlay type hints for where formatting has been disabled would be great.

EDIT: Here's an example of my code that (hopefully) benefits from block formatting:

#[rustfmt::skip]
pub fn command_handler(state: &State, command: Command) -> Effect {
    match (state, command) {
        (State::Idle { observations }, Command::GetObservations)                                         => handle_get_observations(observations),
        (State::Idle { observations }, Command::ProcessAccelerometer { time, ref samples, samples_len }) => handle_process_accelerometer(observations, time, &samples[0..samples_len]),
        (State::Idle { .. },           Command::SetInsideMovement { time })                              => handle_set_inside_movement(time),
        (State::Idle { .. },           Command::SetOutsideMovement { time })                             => handle_set_outside_movement(time),
        (State::Idle { .. },           Command::Timeout)                                                 => Effect::None,

This is what it looks like with inlay types enabled:

image

Thanks for any consideration.

Refs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions