mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Add an option to minimize parentheses for adjustment hints
This commit is contained in:
parent
b89c4f0a05
commit
12b7f9f7bf
7 changed files with 162 additions and 29 deletions
|
@ -35,7 +35,7 @@ pub struct InlayHintsConfig {
|
|||
pub parameter_hints: bool,
|
||||
pub chaining_hints: bool,
|
||||
pub adjustment_hints: AdjustmentHints,
|
||||
pub adjustment_hints_postfix: bool,
|
||||
pub adjustment_hints_mode: AdjustmentHintsMode,
|
||||
pub adjustment_hints_hide_outside_unsafe: bool,
|
||||
pub closure_return_type_hints: ClosureReturnTypeHints,
|
||||
pub binding_mode_hints: bool,
|
||||
|
@ -75,6 +75,14 @@ pub enum AdjustmentHints {
|
|||
Never,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum AdjustmentHintsMode {
|
||||
Prefix,
|
||||
Postfix,
|
||||
PreferPrefix,
|
||||
PreferPostfix,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum InlayKind {
|
||||
BindingModeHint,
|
||||
|
@ -432,7 +440,7 @@ mod tests {
|
|||
use itertools::Itertools;
|
||||
use test_utils::extract_annotations;
|
||||
|
||||
use crate::inlay_hints::AdjustmentHints;
|
||||
use crate::inlay_hints::{AdjustmentHints, AdjustmentHintsMode};
|
||||
use crate::DiscriminantHints;
|
||||
use crate::{fixture, inlay_hints::InlayHintsConfig, LifetimeElisionHints};
|
||||
|
||||
|
@ -448,7 +456,7 @@ mod tests {
|
|||
lifetime_elision_hints: LifetimeElisionHints::Never,
|
||||
closure_return_type_hints: ClosureReturnTypeHints::Never,
|
||||
adjustment_hints: AdjustmentHints::Never,
|
||||
adjustment_hints_postfix: false,
|
||||
adjustment_hints_mode: AdjustmentHintsMode::Prefix,
|
||||
adjustment_hints_hide_outside_unsafe: false,
|
||||
binding_mode_hints: false,
|
||||
hide_named_constructor_hints: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue