diff options
Diffstat (limited to 'crates/ide/src/diagnostics.rs')
-rw-r--r-- | crates/ide/src/diagnostics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index 2e5395b51..b35bc2bae 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -18,7 +18,7 @@ use itertools::Itertools; | |||
18 | use rustc_hash::FxHashSet; | 18 | use rustc_hash::FxHashSet; |
19 | use syntax::{ | 19 | use syntax::{ |
20 | ast::{self, AstNode}, | 20 | ast::{self, AstNode}, |
21 | SyntaxNode, TextRange, T, | 21 | SyntaxNode, TextRange, |
22 | }; | 22 | }; |
23 | use text_edit::TextEdit; | 23 | use text_edit::TextEdit; |
24 | 24 | ||
@@ -232,7 +232,7 @@ fn text_edit_for_remove_unnecessary_braces_with_self_in_use_statement( | |||
232 | single_use_tree: &ast::UseTree, | 232 | single_use_tree: &ast::UseTree, |
233 | ) -> Option<TextEdit> { | 233 | ) -> Option<TextEdit> { |
234 | let use_tree_list_node = single_use_tree.syntax().parent()?; | 234 | let use_tree_list_node = single_use_tree.syntax().parent()?; |
235 | if single_use_tree.path()?.segment()?.syntax().first_child_or_token()?.kind() == T![self] { | 235 | if single_use_tree.path()?.segment()?.self_token().is_some() { |
236 | let start = use_tree_list_node.prev_sibling_or_token()?.text_range().start(); | 236 | let start = use_tree_list_node.prev_sibling_or_token()?.text_range().start(); |
237 | let end = use_tree_list_node.text_range().end(); | 237 | let end = use_tree_list_node.text_range().end(); |
238 | return Some(TextEdit::delete(TextRange::new(start, end))); | 238 | return Some(TextEdit::delete(TextRange::new(start, end))); |