diff options
author | Igor Aleksanov <[email protected]> | 2020-10-08 07:27:38 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-10-12 09:05:00 +0100 |
commit | fb0ab9f7456018ff0bac628e05366f976c5af1a7 (patch) | |
tree | 681abdb0ab856c42a586d8851c9708a7ec6f8b88 /crates/ide | |
parent | 66cea8cbaa3320653e760e7b4ce839e055976acf (diff) |
Keep SyntaxNodePtr::range private
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)?; |