From a91071b57be6e64ad2fd277998ada0ae6206457b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jun 2021 13:27:11 +0300 Subject: internal: cut deps between assists and diagnostics --- crates/ide_diagnostics/src/incorrect_case.rs | 3 +-- crates/ide_diagnostics/src/lib.rs | 5 ++--- crates/ide_diagnostics/src/missing_fields.rs | 3 +-- crates/ide_diagnostics/src/missing_ok_or_some_in_tail_expr.rs | 3 +-- crates/ide_diagnostics/src/unresolved_module.rs | 3 +-- 5 files changed, 6 insertions(+), 11 deletions(-) (limited to 'crates/ide_diagnostics/src') diff --git a/crates/ide_diagnostics/src/incorrect_case.rs b/crates/ide_diagnostics/src/incorrect_case.rs index 04fc779ce..8e1a93aa7 100644 --- a/crates/ide_diagnostics/src/incorrect_case.rs +++ b/crates/ide_diagnostics/src/incorrect_case.rs @@ -1,6 +1,5 @@ use hir::{db::AstDatabase, InFile}; -use ide_assists::Assist; -use ide_db::base_db::FilePosition; +use ide_db::{assists::Assist, base_db::FilePosition}; use syntax::AstNode; use crate::{ diff --git a/crates/ide_diagnostics/src/lib.rs b/crates/ide_diagnostics/src/lib.rs index 0d98307a2..2a16c73a8 100644 --- a/crates/ide_diagnostics/src/lib.rs +++ b/crates/ide_diagnostics/src/lib.rs @@ -28,6 +28,7 @@ mod field_shorthand; use hir::{diagnostics::AnyDiagnostic, Semantics}; use ide_db::{ + assists::{Assist, AssistId, AssistKind, AssistResolveStrategy}, base_db::{FileId, SourceDatabase}, label::Label, source_change::SourceChange, @@ -42,8 +43,6 @@ use syntax::{ use text_edit::TextEdit; use unlinked_file::UnlinkedFile; -use ide_assists::{Assist, AssistId, AssistKind, AssistResolveStrategy}; - #[derive(Copy, Clone, Debug, PartialEq)] pub struct DiagnosticCode(pub &'static str); @@ -265,8 +264,8 @@ fn unresolved_fix(id: &'static str, label: &str, target: TextRange) -> Assist { #[cfg(test)] mod tests { use expect_test::Expect; - use ide_assists::AssistResolveStrategy; use ide_db::{ + assists::AssistResolveStrategy, base_db::{fixture::WithFixture, SourceDatabaseExt}, RootDatabase, }; diff --git a/crates/ide_diagnostics/src/missing_fields.rs b/crates/ide_diagnostics/src/missing_fields.rs index f242ee481..5af67f461 100644 --- a/crates/ide_diagnostics/src/missing_fields.rs +++ b/crates/ide_diagnostics/src/missing_fields.rs @@ -1,7 +1,6 @@ use either::Either; use hir::{db::AstDatabase, InFile}; -use ide_assists::Assist; -use ide_db::source_change::SourceChange; +use ide_db::{assists::Assist, source_change::SourceChange}; use stdx::format_to; use syntax::{algo, ast::make, AstNode, SyntaxNodePtr}; use text_edit::TextEdit; diff --git a/crates/ide_diagnostics/src/missing_ok_or_some_in_tail_expr.rs b/crates/ide_diagnostics/src/missing_ok_or_some_in_tail_expr.rs index 9e36ca296..01c79b6f5 100644 --- a/crates/ide_diagnostics/src/missing_ok_or_some_in_tail_expr.rs +++ b/crates/ide_diagnostics/src/missing_ok_or_some_in_tail_expr.rs @@ -1,6 +1,5 @@ use hir::db::AstDatabase; -use ide_assists::Assist; -use ide_db::source_change::SourceChange; +use ide_db::{assists::Assist, source_change::SourceChange}; use syntax::AstNode; use text_edit::TextEdit; diff --git a/crates/ide_diagnostics/src/unresolved_module.rs b/crates/ide_diagnostics/src/unresolved_module.rs index b11e71b3e..5aa9dae17 100644 --- a/crates/ide_diagnostics/src/unresolved_module.rs +++ b/crates/ide_diagnostics/src/unresolved_module.rs @@ -1,6 +1,5 @@ use hir::db::AstDatabase; -use ide_assists::Assist; -use ide_db::{base_db::AnchoredPathBuf, source_change::FileSystemEdit}; +use ide_db::{assists::Assist, base_db::AnchoredPathBuf, source_change::FileSystemEdit}; use syntax::AstNode; use crate::{fix, Diagnostic, DiagnosticsContext}; -- cgit v1.2.3