aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/diagnostics.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-11-27 15:29:40 +0000
committerJonas Schievink <[email protected]>2020-11-27 15:29:40 +0000
commitd171838d63907d004ab935d6564bfeb4238d5540 (patch)
tree5c8d1a42cedda2027a6214727e4ad7cd4ffc4fa9 /crates/hir_def/src/diagnostics.rs
parent0432aa0ed7be3f41d41928499abc688a956214cf (diff)
More accurately place proc-macro diagnostic
Diffstat (limited to 'crates/hir_def/src/diagnostics.rs')
-rw-r--r--crates/hir_def/src/diagnostics.rs5
1 files changed, 4 insertions, 1 deletions
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;
6use cfg::{CfgExpr, CfgOptions, DnfExpr}; 6use cfg::{CfgExpr, CfgOptions, DnfExpr};
7use hir_expand::diagnostics::{Diagnostic, DiagnosticCode, DiagnosticSink}; 7use hir_expand::diagnostics::{Diagnostic, DiagnosticCode, DiagnosticSink};
8use hir_expand::{HirFileId, InFile}; 8use hir_expand::{HirFileId, InFile};
9use syntax::{ast, AstPtr, SyntaxNodePtr}; 9use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange};
10 10
11use crate::{db::DefDatabase, DefWithBodyId}; 11use crate::{db::DefDatabase, DefWithBodyId};
12 12
@@ -137,6 +137,9 @@ impl Diagnostic for InactiveCode {
137pub struct UnresolvedProcMacro { 137pub struct UnresolvedProcMacro {
138 pub file: HirFileId, 138 pub file: HirFileId,
139 pub node: SyntaxNodePtr, 139 pub node: SyntaxNodePtr,
140 /// If the diagnostic can be pinpointed more accurately than via `node`, this is the `TextRange`
141 /// to use instead.
142 pub precise_location: Option<TextRange>,
140 pub macro_name: Option<String>, 143 pub macro_name: Option<String>,
141} 144}
142 145