diff options
author | Aleksey Kladov <[email protected]> | 2019-05-13 17:39:06 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-13 17:39:06 +0100 |
commit | 549728bba87ed8f4375f27bb9a77223bf8f65452 (patch) | |
tree | 7d2711f243047a5e7ee74d7181905a36ae2c033d /crates/ra_hir/src/diagnostics.rs | |
parent | 033a32f34944d7e07facd900a78db59b35e6698c (diff) |
make AstId untyped
Diffstat (limited to 'crates/ra_hir/src/diagnostics.rs')
-rw-r--r-- | crates/ra_hir/src/diagnostics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index 61cd9d6b1..d41525779 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::{fmt, any::Any}; | 1 | use std::{fmt, any::Any}; |
2 | 2 | ||
3 | use ra_syntax::{SyntaxNodePtr, TreeArc, AstPtr, TextRange, ast, SyntaxNode}; | 3 | use ra_syntax::{SyntaxNodePtr, TreeArc, AstPtr, TextRange, ast, SyntaxNode, AstNode}; |
4 | use relative_path::RelativePathBuf; | 4 | use relative_path::RelativePathBuf; |
5 | 5 | ||
6 | use crate::{HirFileId, HirDatabase, Name}; | 6 | use crate::{HirFileId, HirDatabase, Name}; |
@@ -30,7 +30,7 @@ pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static { | |||
30 | impl dyn Diagnostic { | 30 | impl dyn Diagnostic { |
31 | pub fn syntax_node(&self, db: &impl HirDatabase) -> TreeArc<SyntaxNode> { | 31 | pub fn syntax_node(&self, db: &impl HirDatabase) -> TreeArc<SyntaxNode> { |
32 | let source_file = db.hir_parse(self.file()); | 32 | let source_file = db.hir_parse(self.file()); |
33 | self.syntax_node_ptr().to_node(&source_file).to_owned() | 33 | self.syntax_node_ptr().to_node(source_file.syntax()).to_owned() |
34 | } | 34 | } |
35 | pub fn downcast_ref<D: Diagnostic>(&self) -> Option<&D> { | 35 | pub fn downcast_ref<D: Diagnostic>(&self) -> Option<&D> { |
36 | self.as_any().downcast_ref() | 36 | self.as_any().downcast_ref() |