diff options
author | Kirill Bulatov <[email protected]> | 2020-07-27 20:46:25 +0100 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-08-11 13:09:08 +0100 |
commit | ee1586c1ed058ff0f090b552d52fe6bbe2dd7f7f (patch) | |
tree | 8cb1dc2bb49f8607b6346eee6ab2d27b7e0f5654 /crates/ra_hir | |
parent | a61f2445cba2a48bb7ea6c8477e3198b297f3c67 (diff) |
Better naming
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index e392130ab..1c5dc3d51 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -145,6 +145,10 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { | |||
145 | self.imp.original_range(node) | 145 | self.imp.original_range(node) |
146 | } | 146 | } |
147 | 147 | ||
148 | pub fn diagnostics_fix_range(&self, diagnostics: &dyn Diagnostic) -> FileRange { | ||
149 | self.imp.diagnostics_fix_range(diagnostics) | ||
150 | } | ||
151 | |||
148 | pub fn diagnostics_range(&self, diagnostics: &dyn Diagnostic) -> FileRange { | 152 | pub fn diagnostics_range(&self, diagnostics: &dyn Diagnostic) -> FileRange { |
149 | self.imp.diagnostics_range(diagnostics) | 153 | self.imp.diagnostics_range(diagnostics) |
150 | } | 154 | } |
@@ -376,6 +380,13 @@ impl<'db> SemanticsImpl<'db> { | |||
376 | original_range(self.db, node.as_ref()) | 380 | original_range(self.db, node.as_ref()) |
377 | } | 381 | } |
378 | 382 | ||
383 | fn diagnostics_fix_range(&self, diagnostics: &dyn Diagnostic) -> FileRange { | ||
384 | let src = diagnostics.fix_source(); | ||
385 | let root = self.db.parse_or_expand(src.file_id).unwrap(); | ||
386 | let node = src.value.to_node(&root); | ||
387 | original_range(self.db, src.with_value(&node)) | ||
388 | } | ||
389 | |||
379 | fn diagnostics_range(&self, diagnostics: &dyn Diagnostic) -> FileRange { | 390 | fn diagnostics_range(&self, diagnostics: &dyn Diagnostic) -> FileRange { |
380 | let src = diagnostics.source(); | 391 | let src = diagnostics.source(); |
381 | let root = self.db.parse_or_expand(src.file_id).unwrap(); | 392 | let root = self.db.parse_or_expand(src.file_id).unwrap(); |