From d171838d63907d004ab935d6564bfeb4238d5540 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 27 Nov 2020 16:29:40 +0100 Subject: More accurately place proc-macro diagnostic --- crates/hir_def/src/diagnostics.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/hir_def/src/diagnostics.rs') diff --git a/crates/hir_def/src/diagnostics.rs b/crates/hir_def/src/diagnostics.rs index dd06e3f20..c71266dc0 100644 --- a/crates/hir_def/src/diagnostics.rs +++ b/crates/hir_def/src/diagnostics.rs @@ -6,7 +6,7 @@ use stdx::format_to; use cfg::{CfgExpr, CfgOptions, DnfExpr}; use hir_expand::diagnostics::{Diagnostic, DiagnosticCode, DiagnosticSink}; use hir_expand::{HirFileId, InFile}; -use syntax::{ast, AstPtr, SyntaxNodePtr}; +use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange}; use crate::{db::DefDatabase, DefWithBodyId}; @@ -137,6 +137,9 @@ impl Diagnostic for InactiveCode { pub struct UnresolvedProcMacro { pub file: HirFileId, pub node: SyntaxNodePtr, + /// If the diagnostic can be pinpointed more accurately than via `node`, this is the `TextRange` + /// to use instead. + pub precise_location: Option, pub macro_name: Option, } -- cgit v1.2.3