diff options
author | Aleksey Kladov <[email protected]> | 2021-06-13 18:13:15 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-13 18:14:12 +0100 |
commit | 74f3cca85ab870614f314c6180e2fbb883ad4fe3 (patch) | |
tree | 69f0f7aac85ae2fe0a6907a956b94b0bd434ea7e /crates/ide/src/diagnostics.rs | |
parent | 8d391ec981562785ec92ce3afe950972c523f925 (diff) |
internal: refactor remove this semicolon diagnostics
Diffstat (limited to 'crates/ide/src/diagnostics.rs')
-rw-r--r-- | crates/ide/src/diagnostics.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index 4c92d0cf4..3ced08f30 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -11,6 +11,7 @@ mod mismatched_arg_count; | |||
11 | mod missing_fields; | 11 | mod missing_fields; |
12 | mod missing_unsafe; | 12 | mod missing_unsafe; |
13 | mod no_such_field; | 13 | mod no_such_field; |
14 | mod remove_this_semicolon; | ||
14 | mod unimplemented_builtin_macro; | 15 | mod unimplemented_builtin_macro; |
15 | mod unresolved_extern_crate; | 16 | mod unresolved_extern_crate; |
16 | mod unresolved_import; | 17 | mod unresolved_import; |
@@ -165,9 +166,6 @@ pub(crate) fn diagnostics( | |||
165 | .on::<hir::diagnostics::MissingOkOrSomeInTailExpr, _>(|d| { | 166 | .on::<hir::diagnostics::MissingOkOrSomeInTailExpr, _>(|d| { |
166 | res.borrow_mut().push(diagnostic_with_fix(d, &sema, resolve)); | 167 | res.borrow_mut().push(diagnostic_with_fix(d, &sema, resolve)); |
167 | }) | 168 | }) |
168 | .on::<hir::diagnostics::RemoveThisSemicolon, _>(|d| { | ||
169 | res.borrow_mut().push(diagnostic_with_fix(d, &sema, resolve)); | ||
170 | }) | ||
171 | .on::<hir::diagnostics::IncorrectCase, _>(|d| { | 169 | .on::<hir::diagnostics::IncorrectCase, _>(|d| { |
172 | res.borrow_mut().push(warning_with_fix(d, &sema, resolve)); | 170 | res.borrow_mut().push(warning_with_fix(d, &sema, resolve)); |
173 | }) | 171 | }) |
@@ -223,10 +221,11 @@ pub(crate) fn diagnostics( | |||
223 | let d = match diag { | 221 | let d = match diag { |
224 | AnyDiagnostic::BreakOutsideOfLoop(d) => break_outside_of_loop::break_outside_of_loop(&ctx, &d), | 222 | AnyDiagnostic::BreakOutsideOfLoop(d) => break_outside_of_loop::break_outside_of_loop(&ctx, &d), |
225 | AnyDiagnostic::MacroError(d) => macro_error::macro_error(&ctx, &d), | 223 | AnyDiagnostic::MacroError(d) => macro_error::macro_error(&ctx, &d), |
224 | AnyDiagnostic::MismatchedArgCount(d) => mismatched_arg_count::mismatched_arg_count(&ctx, &d), | ||
226 | AnyDiagnostic::MissingFields(d) => missing_fields::missing_fields(&ctx, &d), | 225 | AnyDiagnostic::MissingFields(d) => missing_fields::missing_fields(&ctx, &d), |
227 | AnyDiagnostic::MissingUnsafe(d) => missing_unsafe::missing_unsafe(&ctx, &d), | 226 | AnyDiagnostic::MissingUnsafe(d) => missing_unsafe::missing_unsafe(&ctx, &d), |
228 | AnyDiagnostic::MismatchedArgCount(d) => mismatched_arg_count::mismatched_arg_count(&ctx, &d), | ||
229 | AnyDiagnostic::NoSuchField(d) => no_such_field::no_such_field(&ctx, &d), | 227 | AnyDiagnostic::NoSuchField(d) => no_such_field::no_such_field(&ctx, &d), |
228 | AnyDiagnostic::RemoveThisSemicolon(d) => remove_this_semicolon::remove_this_semicolon(&ctx, &d), | ||
230 | AnyDiagnostic::UnimplementedBuiltinMacro(d) => unimplemented_builtin_macro::unimplemented_builtin_macro(&ctx, &d), | 229 | AnyDiagnostic::UnimplementedBuiltinMacro(d) => unimplemented_builtin_macro::unimplemented_builtin_macro(&ctx, &d), |
231 | AnyDiagnostic::UnresolvedExternCrate(d) => unresolved_extern_crate::unresolved_extern_crate(&ctx, &d), | 230 | AnyDiagnostic::UnresolvedExternCrate(d) => unresolved_extern_crate::unresolved_extern_crate(&ctx, &d), |
232 | AnyDiagnostic::UnresolvedImport(d) => unresolved_import::unresolved_import(&ctx, &d), | 231 | AnyDiagnostic::UnresolvedImport(d) => unresolved_import::unresolved_import(&ctx, &d), |
@@ -839,16 +838,6 @@ fn x(a: S) { | |||
839 | } | 838 | } |
840 | 839 | ||
841 | #[test] | 840 | #[test] |
842 | fn missing_semicolon() { | ||
843 | check_diagnostics( | ||
844 | r#" | ||
845 | fn test() -> i32 { 123; } | ||
846 | //^^^ Remove this semicolon | ||
847 | "#, | ||
848 | ); | ||
849 | } | ||
850 | |||
851 | #[test] | ||
852 | fn import_extern_crate_clash_with_inner_item() { | 841 | fn import_extern_crate_clash_with_inner_item() { |
853 | // This is more of a resolver test, but doesn't really work with the hir_def testsuite. | 842 | // This is more of a resolver test, but doesn't really work with the hir_def testsuite. |
854 | 843 | ||