aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/diagnostics
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-13 17:35:30 +0100
committerAleksey Kladov <[email protected]>2021-06-13 17:35:30 +0100
commitd3621eeb02652038a8185f60d78fb4791a732dc6 (patch)
tree0e200e563949977ffd0a857555d4ff874ab758dd /crates/ide/src/diagnostics
parentdec207f56a7b16075f68dcb89138d93a7eecdf43 (diff)
internal: refactor unimplemented builtin macro diagnostic
Diffstat (limited to 'crates/ide/src/diagnostics')
-rw-r--r--crates/ide/src/diagnostics/unimplemented_builtin_macro.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics/unimplemented_builtin_macro.rs b/crates/ide/src/diagnostics/unimplemented_builtin_macro.rs
new file mode 100644
index 000000000..09faa3bbc
--- /dev/null
+++ b/crates/ide/src/diagnostics/unimplemented_builtin_macro.rs
@@ -0,0 +1,19 @@
1use crate::{
2 diagnostics::{Diagnostic, DiagnosticsContext},
3 Severity,
4};
5
6// Diagnostic: unimplemented-builtin-macro
7//
8// This diagnostic is shown for builtin macros which are not yet implemented by rust-analyzer
9pub(super) fn unimplemented_builtin_macro(
10 ctx: &DiagnosticsContext<'_>,
11 d: &hir::UnimplementedBuiltinMacro,
12) -> Diagnostic {
13 Diagnostic::new(
14 "unimplemented-builtin-macro",
15 "unimplemented built-in macro".to_string(),
16 ctx.sema.diagnostics_display_range(d.node.clone()).range,
17 )
18 .severity(Severity::WeakWarning)
19}