Auto merge of #14990 - HKalbasi:diagnostic-map, r=HKalbasi

Map our diagnostics to rustc and clippy's ones

And control their severity by lint attributes `#[allow]`, `#[deny]` and ... .

It doesn't work with proc macros and I would like to fix that before merge but I don't know how to do it.
This commit is contained in:
bors 2023-07-03 18:58:47 +00:00
commit 45272efec5
44 changed files with 628 additions and 251 deletions

View file

@ -14,7 +14,7 @@ use syntax::{
};
use text_edit::TextEdit;
use crate::{fix, Assist, Diagnostic, DiagnosticsContext, Severity};
use crate::{fix, Assist, Diagnostic, DiagnosticCode, DiagnosticsContext, Severity};
// Diagnostic: unlinked-file
//
@ -46,8 +46,7 @@ pub(crate) fn unlinked_file(
.unwrap_or(range);
acc.push(
Diagnostic::new("unlinked-file", message, range)
.severity(Severity::WeakWarning)
Diagnostic::new(DiagnosticCode::Ra("unlinked-file", Severity::WeakWarning), message, range)
.with_fixes(fixes),
);
}