aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/diagnostics.rs
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-21 00:11:41 +0000
committerSeivan Heidari <[email protected]>2019-11-21 00:11:41 +0000
commit358a1bcd708c622836723e5201b6de77cc9ff327 (patch)
treeaeff9c96a6059fa2b02e7c87ec88753bc7993d8d /crates/ra_hir_expand/src/diagnostics.rs
parent1e2d090ab8a9bda18f148b894b7948eb05b976e6 (diff)
parent612a72fc4ea4376920f2a7da7b3c334227c1716c (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_hir_expand/src/diagnostics.rs')
-rw-r--r--crates/ra_hir_expand/src/diagnostics.rs4
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 {
37impl dyn Diagnostic { 37impl 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> {