diff options
author | Aleksey Kladov <[email protected]> | 2020-04-17 12:55:05 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-17 12:56:42 +0100 |
commit | 146f6f5a45a4bfd98ab0eb54bb30610d784433c9 (patch) | |
tree | e56f182d50f8863c2535fcd9d736ffb4e3425ae6 /crates/ra_hir_ty/src/infer.rs | |
parent | a8196ffe8466aa60dec56e77c2da717793c0debe (diff) |
Simplify Diagnostic structure
It's not entirely clear what subnode ranges should mean in the
presence of macros, so let's leave them out for now. We are not using
them heavily anyway.
Diffstat (limited to 'crates/ra_hir_ty/src/infer.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 7e6cdefe4..b6d9b3438 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -665,7 +665,6 @@ impl Expectation { | |||
665 | mod diagnostics { | 665 | mod diagnostics { |
666 | use hir_def::{expr::ExprId, src::HasSource, FunctionId, Lookup}; | 666 | use hir_def::{expr::ExprId, src::HasSource, FunctionId, Lookup}; |
667 | use hir_expand::diagnostics::DiagnosticSink; | 667 | use hir_expand::diagnostics::DiagnosticSink; |
668 | use ra_syntax::AstNode; | ||
669 | 668 | ||
670 | use crate::{db::HirDatabase, diagnostics::NoSuchField}; | 669 | use crate::{db::HirDatabase, diagnostics::NoSuchField}; |
671 | 670 | ||
@@ -686,13 +685,7 @@ mod diagnostics { | |||
686 | let source = owner.lookup(db.upcast()).source(db.upcast()); | 685 | let source = owner.lookup(db.upcast()).source(db.upcast()); |
687 | let (_, source_map) = db.body_with_source_map(owner.into()); | 686 | let (_, source_map) = db.body_with_source_map(owner.into()); |
688 | let field = source_map.field_syntax(*expr, *field); | 687 | let field = source_map.field_syntax(*expr, *field); |
689 | let root = field.file_syntax(db.upcast()); | 688 | sink.push(NoSuchField { file: source.file_id, field: field.value }) |
690 | let highlight_range = field.value.to_node(&root).syntax().text_range(); | ||
691 | sink.push(NoSuchField { | ||
692 | file: source.file_id, | ||
693 | field: field.value, | ||
694 | highlight_range, | ||
695 | }) | ||
696 | } | 689 | } |
697 | } | 690 | } |
698 | } | 691 | } |