mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
internal: move missing_fields diagnostics
This commit is contained in:
parent
efa069d288
commit
c6509a4592
6 changed files with 97 additions and 108 deletions
|
@ -5,6 +5,7 @@
|
|||
//! original files. So we need to map the ranges.
|
||||
|
||||
mod unresolved_module;
|
||||
mod missing_fields;
|
||||
|
||||
mod fixes;
|
||||
mod field_shorthand;
|
||||
|
@ -123,9 +124,6 @@ pub(crate) fn diagnostics(
|
|||
}
|
||||
let res = RefCell::new(res);
|
||||
let sink_builder = DiagnosticSinkBuilder::new()
|
||||
.on::<hir::diagnostics::MissingFields, _>(|d| {
|
||||
res.borrow_mut().push(diagnostic_with_fix(d, &sema, resolve));
|
||||
})
|
||||
.on::<hir::diagnostics::MissingOkOrSomeInTailExpr, _>(|d| {
|
||||
res.borrow_mut().push(diagnostic_with_fix(d, &sema, resolve));
|
||||
})
|
||||
|
@ -232,7 +230,8 @@ pub(crate) fn diagnostics(
|
|||
let ctx = DiagnosticsContext { config, sema, resolve };
|
||||
for diag in diags {
|
||||
let d = match diag {
|
||||
AnyDiagnostic::UnresolvedModule(d) => unresolved_module::render(&ctx, &d),
|
||||
AnyDiagnostic::UnresolvedModule(d) => unresolved_module::unresolved_module(&ctx, &d),
|
||||
AnyDiagnostic::MissingFields(d) => missing_fields::missing_fields(&ctx, &d),
|
||||
};
|
||||
if let Some(code) = d.code {
|
||||
if ctx.config.disabled.contains(code.as_str()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue