aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ide/src/diagnostics/fixes.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs
index 29c7a040b..a900d7bae 100644
--- a/crates/ide/src/diagnostics/fixes.rs
+++ b/crates/ide/src/diagnostics/fixes.rs
@@ -6,7 +6,7 @@ use hir::{
6 Diagnostic, IncorrectCase, MissingFields, MissingOkInTailExpr, NoSuchField, 6 Diagnostic, IncorrectCase, MissingFields, MissingOkInTailExpr, NoSuchField,
7 UnresolvedModule, 7 UnresolvedModule,
8 }, 8 },
9 HasSource, HirDisplay, Semantics, VariantDef, 9 HasSource, HirDisplay, InFile, Semantics, VariantDef,
10}; 10};
11use ide_db::base_db::{AnchoredPathBuf, FileId}; 11use ide_db::base_db::{AnchoredPathBuf, FileId};
12use ide_db::{ 12use ide_db::{
@@ -110,9 +110,9 @@ impl DiagnosticWithFix for IncorrectCase {
110 let root = sema.db.parse_or_expand(self.file)?; 110 let root = sema.db.parse_or_expand(self.file)?;
111 let name_node = self.ident.to_node(&root); 111 let name_node = self.ident.to_node(&root);
112 112
113 let file_id = self.file.original_file(sema.db); 113 let name_node = InFile::new(self.file, name_node.syntax());
114 let offset = name_node.syntax().text_range().start(); 114 let frange = name_node.original_file_range(sema.db);
115 let file_position = FilePosition { file_id, offset }; 115 let file_position = FilePosition { file_id: frange.file_id, offset: frange.range.start() };
116 116
117 let rename_changes = 117 let rename_changes =
118 rename_with_semantics(sema, file_position, &self.suggested_text).ok()?; 118 rename_with_semantics(sema, file_position, &self.suggested_text).ok()?;