diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/diagnostics/fixes.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 286ef0785..b47fe0469 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs | |||
@@ -104,8 +104,11 @@ impl DiagnosticWithFix for MissingOkInTailExpr { | |||
104 | 104 | ||
105 | impl DiagnosticWithFix for IncorrectCase { | 105 | impl DiagnosticWithFix for IncorrectCase { |
106 | fn fix(&self, sema: &Semantics<RootDatabase>) -> Option<Fix> { | 106 | fn fix(&self, sema: &Semantics<RootDatabase>) -> Option<Fix> { |
107 | let root = sema.db.parse_or_expand(self.file)?; | ||
108 | let name_node = self.ident.to_node(&root); | ||
109 | |||
107 | let file_id = self.file.original_file(sema.db); | 110 | let file_id = self.file.original_file(sema.db); |
108 | let offset = self.ident.text_range().start(); | 111 | let offset = name_node.syntax().text_range().start(); |
109 | let file_position = FilePosition { file_id, offset }; | 112 | let file_position = FilePosition { file_id, offset }; |
110 | 113 | ||
111 | let rename_changes = rename_with_semantics(sema, file_position, &self.suggested_text)?; | 114 | let rename_changes = rename_with_semantics(sema, file_position, &self.suggested_text)?; |