diff options
author | Lukas Wirth <[email protected]> | 2021-02-09 15:03:39 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-02-12 17:58:29 +0000 |
commit | c5be0b2589e5ed732ae5001122e453f0903bfdf2 (patch) | |
tree | e60864d41fd22f995b424b057f4e225609577c26 /crates/assists | |
parent | d644728d82df10b034d0ea736590c781afa2ba15 (diff) |
Use NameLike in FileReference directly as its not exported from ide anymore
Diffstat (limited to 'crates/assists')
-rw-r--r-- | crates/assists/src/handlers/inline_local_variable.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/assists/src/handlers/inline_local_variable.rs b/crates/assists/src/handlers/inline_local_variable.rs index e4f984713..8d28431cf 100644 --- a/crates/assists/src/handlers/inline_local_variable.rs +++ b/crates/assists/src/handlers/inline_local_variable.rs | |||
@@ -124,11 +124,10 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | |||
124 | move |builder| { | 124 | move |builder| { |
125 | builder.delete(delete_range); | 125 | builder.delete(delete_range); |
126 | for (file_id, references) in usages.references { | 126 | for (file_id, references) in usages.references { |
127 | let root = ctx.sema.parse(file_id); | ||
128 | for (&should_wrap, reference) in wrap_in_parens[&file_id].iter().zip(references) { | 127 | for (&should_wrap, reference) in wrap_in_parens[&file_id].iter().zip(references) { |
129 | let replacement = | 128 | let replacement = |
130 | if should_wrap { init_in_paren.clone() } else { init_str.clone() }; | 129 | if should_wrap { init_in_paren.clone() } else { init_str.clone() }; |
131 | match &reference.as_name_ref(root.syntax()) { | 130 | match reference.name.as_name_ref() { |
132 | Some(name_ref) | 131 | Some(name_ref) |
133 | if ast::RecordExprField::for_field_name(name_ref).is_some() => | 132 | if ast::RecordExprField::for_field_name(name_ref).is_some() => |
134 | { | 133 | { |