diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-09 09:16:29 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-09 09:16:29 +0000 |
| commit | 625ec9e1ae69168f194cbc5bf20846870f03e149 (patch) | |
| tree | a880e76d62e743bc39bc0b052cd37654e16484f6 | |
| parent | 5fe8cb1fba2f0fec72f62758fbf02b18fc178d4c (diff) | |
| parent | 38dd9aa284ebe4a980ffb29b128babae5c8f937a (diff) | |
| download | rust-625ec9e1ae69168f194cbc5bf20846870f03e149.tar.gz rust-625ec9e1ae69168f194cbc5bf20846870f03e149.zip | |
Merge #7215
7215: Hide argument name hint regardless of case r=SomeoneToIgnore a=jhpratt Co-authored-by: Jacob Pratt <jacob@jhpratt.dev>
| -rw-r--r-- | crates/ide/src/inlay_hints.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index fe60abfc856..a74829cd0d8 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -353,9 +353,13 @@ fn is_argument_similar_to_param_name( } match get_string_representation(argument) { None => false, - Some(repr) => { - let argument_string = repr.trim_start_matches('_'); - argument_string.starts_with(param_name) || argument_string.ends_with(param_name) + Some(mut repr) => { + let param_name = param_name.to_ascii_lowercase(); + let argument_string = { + repr.make_ascii_lowercase(); + repr.trim_start_matches('_') + }; + argument_string.starts_with(¶m_name) || argument_string.ends_with(¶m_name) } } } @@ -901,6 +905,9 @@ fn main() { twiddle(true); doo(true); + const TWIDDLE_UPPERCASE: bool = true; + twiddle(TWIDDLE_UPPERCASE); + let mut param_begin: Param = Param {}; different_order(¶m_begin); different_order(&mut param_begin); |
