From c395dd1032b66e28995189a26ed688b243d3cef8 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 12 Feb 2021 21:30:55 +0100 Subject: Implement constructor usage search for almost all items For all struct kinds, unions and enums, as well as for record- and tuple-variants but not for unit-variants, as these have no trailing character we can anchor the search to. Functionality wise it is implemented though. --- crates/assists/src/handlers/inline_local_variable.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/assists') diff --git a/crates/assists/src/handlers/inline_local_variable.rs b/crates/assists/src/handlers/inline_local_variable.rs index 8d28431cf..9b228443f 100644 --- a/crates/assists/src/handlers/inline_local_variable.rs +++ b/crates/assists/src/handlers/inline_local_variable.rs @@ -1,6 +1,5 @@ -use std::collections::HashMap; - use ide_db::{defs::Definition, search::FileReference}; +use rustc_hash::FxHashMap; use syntax::{ ast::{self, AstNode, AstToken}, TextRange, @@ -111,7 +110,7 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O .collect::>() .map(|b| (file_id, b)) }) - .collect::>, _>>()?; + .collect::>, _>>()?; let init_str = initializer_expr.syntax().text().to_string(); let init_in_paren = format!("({})", &init_str); -- cgit v1.2.3