From 1d2772c2c7dc0a42d8a9429d24ea41412add61b3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jun 2021 13:15:05 +0300 Subject: internal: move diagnostics to a new crate --- .../ide/src/diagnostics/unresolved_proc_macro.rs | 30 ---------------------- 1 file changed, 30 deletions(-) delete mode 100644 crates/ide/src/diagnostics/unresolved_proc_macro.rs (limited to 'crates/ide/src/diagnostics/unresolved_proc_macro.rs') diff --git a/crates/ide/src/diagnostics/unresolved_proc_macro.rs b/crates/ide/src/diagnostics/unresolved_proc_macro.rs deleted file mode 100644 index 3dc6ab451..000000000 --- a/crates/ide/src/diagnostics/unresolved_proc_macro.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::{ - diagnostics::{Diagnostic, DiagnosticsContext}, - Severity, -}; - -// Diagnostic: unresolved-proc-macro -// -// This diagnostic is shown when a procedural macro can not be found. This usually means that -// procedural macro support is simply disabled (and hence is only a weak hint instead of an error), -// but can also indicate project setup problems. -// -// If you are seeing a lot of "proc macro not expanded" warnings, you can add this option to the -// `rust-analyzer.diagnostics.disabled` list to prevent them from showing. Alternatively you can -// enable support for procedural macros (see `rust-analyzer.procMacro.enable`). -pub(super) fn unresolved_proc_macro( - ctx: &DiagnosticsContext<'_>, - d: &hir::UnresolvedProcMacro, -) -> Diagnostic { - // Use more accurate position if available. - let display_range = d - .precise_location - .unwrap_or_else(|| ctx.sema.diagnostics_display_range(d.node.clone()).range); - // FIXME: it would be nice to tell the user whether proc macros are currently disabled - let message = match &d.macro_name { - Some(name) => format!("proc macro `{}` not expanded", name), - None => "proc macro not expanded".to_string(), - }; - - Diagnostic::new("unresolved-proc-macro", message, display_range).severity(Severity::WeakWarning) -} -- cgit v1.2.3