diff options
author | Kirill Bulatov <[email protected]> | 2020-07-27 16:45:08 +0100 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-08-11 13:09:08 +0100 |
commit | 21e5224484b9214648826e1b15aa9150c79a407c (patch) | |
tree | 39825273cf9d97796ef9e1705004c1171d32efab /crates/ra_hir_expand | |
parent | 26e102a567aadcf86f2e5b575cb6b915991ba088 (diff) |
Custom ranges for missing fields
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/diagnostics.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/ra_hir_expand/src/diagnostics.rs index 84ba97b14..e889f070f 100644 --- a/crates/ra_hir_expand/src/diagnostics.rs +++ b/crates/ra_hir_expand/src/diagnostics.rs | |||
@@ -36,8 +36,9 @@ pub trait AstDiagnostic { | |||
36 | 36 | ||
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 source = self.source(); |
40 | self.source().value.to_node(&node) | 40 | let node = db.parse_or_expand(source.file_id).unwrap(); |
41 | source.value.to_node(&node) | ||
41 | } | 42 | } |
42 | 43 | ||
43 | pub fn downcast_ref<D: Diagnostic>(&self) -> Option<&D> { | 44 | pub fn downcast_ref<D: Diagnostic>(&self) -> Option<&D> { |