aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorJacob Pratt <[email protected]>2021-01-09 08:33:28 +0000
committerJacob Pratt <[email protected]>2021-01-09 09:05:59 +0000
commit38dd9aa284ebe4a980ffb29b128babae5c8f937a (patch)
treea880e76d62e743bc39bc0b052cd37654e16484f6 /crates/ide
parent5fe8cb1fba2f0fec72f62758fbf02b18fc178d4c (diff)
Hide argument name hint regardless of case
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/inlay_hints.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs
index fe60abfc8..a74829cd0 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(
353 } 353 }
354 match get_string_representation(argument) { 354 match get_string_representation(argument) {
355 None => false, 355 None => false,
356 Some(repr) => { 356 Some(mut repr) => {
357 let argument_string = repr.trim_start_matches('_'); 357 let param_name = param_name.to_ascii_lowercase();
358 argument_string.starts_with(param_name) || argument_string.ends_with(param_name) 358 let argument_string = {
359 repr.make_ascii_lowercase();
360 repr.trim_start_matches('_')
361 };
362 argument_string.starts_with(&param_name) || argument_string.ends_with(&param_name)
359 } 363 }
360 } 364 }
361} 365}
@@ -901,6 +905,9 @@ fn main() {
901 twiddle(true); 905 twiddle(true);
902 doo(true); 906 doo(true);
903 907
908 const TWIDDLE_UPPERCASE: bool = true;
909 twiddle(TWIDDLE_UPPERCASE);
910
904 let mut param_begin: Param = Param {}; 911 let mut param_begin: Param = Param {};
905 different_order(&param_begin); 912 different_order(&param_begin);
906 different_order(&mut param_begin); 913 different_order(&mut param_begin);