diff options
Diffstat (limited to 'crates/ra_hir_expand/src/diagnostics.rs')
-rw-r--r-- | crates/ra_hir_expand/src/diagnostics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/ra_hir_expand/src/diagnostics.rs index 201884b95..3d37e9335 100644 --- a/crates/ra_hir_expand/src/diagnostics.rs +++ b/crates/ra_hir_expand/src/diagnostics.rs | |||
@@ -24,7 +24,7 @@ pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static { | |||
24 | fn message(&self) -> String; | 24 | fn message(&self) -> String; |
25 | fn source(&self) -> Source<SyntaxNodePtr>; | 25 | fn source(&self) -> Source<SyntaxNodePtr>; |
26 | fn highlight_range(&self) -> TextRange { | 26 | fn highlight_range(&self) -> TextRange { |
27 | self.source().ast.range() | 27 | self.source().value.range() |
28 | } | 28 | } |
29 | fn as_any(&self) -> &(dyn Any + Send + 'static); | 29 | fn as_any(&self) -> &(dyn Any + Send + 'static); |
30 | } | 30 | } |
@@ -37,7 +37,7 @@ pub trait AstDiagnostic { | |||
37 | impl dyn Diagnostic { | 37 | impl dyn Diagnostic { |
38 | pub fn syntax_node(&self, db: &impl AstDatabase) -> SyntaxNode { | 38 | pub fn syntax_node(&self, db: &impl AstDatabase) -> SyntaxNode { |
39 | let node = db.parse_or_expand(self.source().file_id).unwrap(); | 39 | let node = db.parse_or_expand(self.source().file_id).unwrap(); |
40 | self.source().ast.to_node(&node) | 40 | self.source().value.to_node(&node) |
41 | } | 41 | } |
42 | 42 | ||
43 | pub fn downcast_ref<D: Diagnostic>(&self) -> Option<&D> { | 43 | pub fn downcast_ref<D: Diagnostic>(&self) -> Option<&D> { |