diff options
Diffstat (limited to 'crates/ide/src/diagnostics')
-rw-r--r-- | crates/ide/src/diagnostics/fixes.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 7bbf1d8c7..a73c0778b 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs | |||
@@ -14,7 +14,11 @@ use ide_db::{ | |||
14 | source_change::{FileSystemEdit, SourceChange}, | 14 | source_change::{FileSystemEdit, SourceChange}, |
15 | RootDatabase, | 15 | RootDatabase, |
16 | }; | 16 | }; |
17 | use syntax::{AstNode, TextRange, algo, ast::{self, ArgList, edit::IndentLevel, make}}; | 17 | use syntax::{ |
18 | algo, | ||
19 | ast::{self, edit::IndentLevel, make, ArgList}, | ||
20 | AstNode, TextRange, | ||
21 | }; | ||
18 | use text_edit::TextEdit; | 22 | use text_edit::TextEdit; |
19 | 23 | ||
20 | use crate::{diagnostics::Fix, references::rename::rename_with_semantics, FilePosition}; | 24 | use crate::{diagnostics::Fix, references::rename::rename_with_semantics, FilePosition}; |
@@ -151,7 +155,8 @@ impl DiagnosticWithFix for ReplaceFilterMapNextWithFindMap { | |||
151 | let filter_map_name_range = filter_map_call.name_ref()?.ident_token()?.text_range(); | 155 | let filter_map_name_range = filter_map_call.name_ref()?.ident_token()?.text_range(); |
152 | let filter_map_args = filter_map_call.syntax().children().find_map(ArgList::cast)?; | 156 | let filter_map_args = filter_map_call.syntax().children().find_map(ArgList::cast)?; |
153 | 157 | ||
154 | let range_to_replace = TextRange::new(filter_map_name_range.start(), next_expr.syntax().text_range().end()); | 158 | let range_to_replace = |
159 | TextRange::new(filter_map_name_range.start(), next_expr.syntax().text_range().end()); | ||
155 | let replacement = format!("find_map{}", filter_map_args.syntax().text()); | 160 | let replacement = format!("find_map{}", filter_map_args.syntax().text()); |
156 | let trigger_range = next_expr.syntax().text_range(); | 161 | let trigger_range = next_expr.syntax().text_range(); |
157 | 162 | ||