diff --git a/crates/ide-db/src/syntax_helpers/suggest_name.rs b/crates/ide-db/src/syntax_helpers/suggest_name.rs index 2679cbef61..b3ecc26cb2 100644 --- a/crates/ide-db/src/syntax_helpers/suggest_name.rs +++ b/crates/ide-db/src/syntax_helpers/suggest_name.rs @@ -29,7 +29,7 @@ const USELESS_NAME_PREFIXES: &[&str] = &["from_", "with_", "into_"]; /// # Examples /// `Option` -> `Name` /// `Result` -> `User` -const WRAPPER_TYPES: &[&str] = &["Box", "Option", "Result"]; +const WRAPPER_TYPES: &[&str] = &["Box", "Arc", "Rc", "Option", "Result"]; /// Prefixes to strip from methods names /// @@ -858,6 +858,32 @@ fn foo() { $0(bar())$0; } ); } + #[test] + fn arc_value() { + check( + r#" +struct Arc(*const T); +struct Seed; +fn bar() -> Arc {} +fn foo() { $0(bar())$0; } +"#, + "seed", + ); + } + + #[test] + fn rc_value() { + check( + r#" +struct Rc(*const T); +struct Seed; +fn bar() -> Rc {} +fn foo() { $0(bar())$0; } +"#, + "seed", + ); + } + #[test] fn ref_call() { check(