aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorIgor Aleksanov <[email protected]>2020-10-08 07:27:38 +0100
committerIgor Aleksanov <[email protected]>2020-10-12 09:05:00 +0100
commitfb0ab9f7456018ff0bac628e05366f976c5af1a7 (patch)
tree681abdb0ab856c42a586d8851c9708a7ec6f8b88 /crates/ide
parent66cea8cbaa3320653e760e7b4ce839e055976acf (diff)
Keep SyntaxNodePtr::range private
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/diagnostics/fixes.rs5
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
105impl DiagnosticWithFix for IncorrectCase { 105impl 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)?;