aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-11-26 19:09:54 +0000
committerJonas Schievink <[email protected]>2020-11-27 12:50:22 +0000
commit0432aa0ed7be3f41d41928499abc688a956214cf (patch)
tree64df76e5182412d9a95bc5e63ef3b1db03a5d430 /crates/ide
parent1b2652097183b0a285891c02eea8a7d2af03e4b3 (diff)
Publish diagnostics for macro expansion errors
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/diagnostics.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs
index 3df73ed4f..8b4ceb9a1 100644
--- a/crates/ide/src/diagnostics.rs
+++ b/crates/ide/src/diagnostics.rs
@@ -142,6 +142,13 @@ pub(crate) fn diagnostics(
142 .with_code(Some(d.code())), 142 .with_code(Some(d.code())),
143 ); 143 );
144 }) 144 })
145 .on::<hir::diagnostics::UnresolvedProcMacro, _>(|d| {
146 // FIXME: it would be nice to tell the user whether proc macros are currently disabled
147 res.borrow_mut().push(
148 Diagnostic::hint(sema.diagnostics_display_range(d).range, d.message())
149 .with_code(Some(d.code())),
150 );
151 })
145 // Only collect experimental diagnostics when they're enabled. 152 // Only collect experimental diagnostics when they're enabled.
146 .filter(|diag| !(diag.is_experimental() && config.disable_experimental)) 153 .filter(|diag| !(diag.is_experimental() && config.disable_experimental))
147 .filter(|diag| !config.disabled.contains(diag.code().as_str())); 154 .filter(|diag| !config.disabled.contains(diag.code().as_str()));