diff --git a/crates/ide-diagnostics/src/handlers/json_is_not_rust.rs b/crates/ide-diagnostics/src/handlers/json_is_not_rust.rs index 1011e73988..dca889d1a8 100644 --- a/crates/ide-diagnostics/src/handlers/json_is_not_rust.rs +++ b/crates/ide-diagnostics/src/handlers/json_is_not_rust.rs @@ -2,6 +2,7 @@ //! example. use hir::{ImportPathConfig, PathResolution, Semantics}; +use ide_db::text_edit::TextEdit; use ide_db::{ helpers::mod_path_to_ast, imports::insert_use::{insert_use, ImportScope}, @@ -14,7 +15,6 @@ use syntax::{ ast::{self, make}, Edition, SyntaxKind, SyntaxNode, }; -use ide_db::text_edit::TextEdit; use crate::{fix, Diagnostic, DiagnosticCode, DiagnosticsConfig, Severity}; diff --git a/crates/ide-diagnostics/src/handlers/missing_unsafe.rs b/crates/ide-diagnostics/src/handlers/missing_unsafe.rs index 444b37e75c..a630d3c7c3 100644 --- a/crates/ide-diagnostics/src/handlers/missing_unsafe.rs +++ b/crates/ide-diagnostics/src/handlers/missing_unsafe.rs @@ -1,9 +1,9 @@ use hir::db::ExpandDatabase; use hir::HirFileIdExt; +use ide_db::text_edit::TextEdit; use ide_db::{assists::Assist, source_change::SourceChange}; use syntax::{ast, SyntaxNode}; use syntax::{match_ast, AstNode}; -use ide_db::text_edit::TextEdit; use crate::{fix, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/mutability_errors.rs b/crates/ide-diagnostics/src/handlers/mutability_errors.rs index c24ff934a2..1397979144 100644 --- a/crates/ide-diagnostics/src/handlers/mutability_errors.rs +++ b/crates/ide-diagnostics/src/handlers/mutability_errors.rs @@ -1,7 +1,7 @@ use hir::db::ExpandDatabase; use ide_db::source_change::SourceChange; -use syntax::{ast, AstNode, SyntaxKind, SyntaxNode, SyntaxNodePtr, SyntaxToken, T}; use ide_db::text_edit::TextEdit; +use syntax::{ast, AstNode, SyntaxKind, SyntaxNode, SyntaxNodePtr, SyntaxToken, T}; use crate::{fix, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/no_such_field.rs b/crates/ide-diagnostics/src/handlers/no_such_field.rs index 2bdb208aad..e5d871975b 100644 --- a/crates/ide-diagnostics/src/handlers/no_such_field.rs +++ b/crates/ide-diagnostics/src/handlers/no_such_field.rs @@ -1,11 +1,11 @@ use either::Either; use hir::{db::ExpandDatabase, HasSource, HirDisplay, HirFileIdExt, Semantics, VariantId}; +use ide_db::text_edit::TextEdit; use ide_db::{source_change::SourceChange, EditionedFileId, RootDatabase}; use syntax::{ ast::{self, edit::IndentLevel, make}, AstNode, }; -use ide_db::text_edit::TextEdit; use crate::{fix, Assist, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/remove_trailing_return.rs b/crates/ide-diagnostics/src/handlers/remove_trailing_return.rs index 9326d03cd1..c8e3cff364 100644 --- a/crates/ide-diagnostics/src/handlers/remove_trailing_return.rs +++ b/crates/ide-diagnostics/src/handlers/remove_trailing_return.rs @@ -1,7 +1,7 @@ use hir::{db::ExpandDatabase, diagnostics::RemoveTrailingReturn, FileRange}; +use ide_db::text_edit::TextEdit; use ide_db::{assists::Assist, source_change::SourceChange}; use syntax::{ast, AstNode}; -use ide_db::text_edit::TextEdit; use crate::{adjusted_display_range, fix, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs b/crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs index ae0018d798..a46c48608f 100644 --- a/crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs +++ b/crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs @@ -1,4 +1,5 @@ use hir::{db::ExpandDatabase, diagnostics::RemoveUnnecessaryElse, HirFileIdExt}; +use ide_db::text_edit::TextEdit; use ide_db::{assists::Assist, source_change::SourceChange}; use itertools::Itertools; use syntax::{ @@ -8,7 +9,6 @@ use syntax::{ }, AstNode, SyntaxToken, TextRange, }; -use ide_db::text_edit::TextEdit; use crate::{ adjusted_display_range, fix, Diagnostic, DiagnosticCode, DiagnosticsContext, Severity, diff --git a/crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs b/crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs index fb043fa294..f481365f2a 100644 --- a/crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs +++ b/crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs @@ -1,10 +1,10 @@ use hir::{db::ExpandDatabase, HirFileIdExt, InFile}; use ide_db::source_change::SourceChange; +use ide_db::text_edit::TextEdit; use syntax::{ ast::{self, HasArgList}, AstNode, TextRange, }; -use ide_db::text_edit::TextEdit; use crate::{fix, Assist, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs b/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs index 0877b7f2e4..1363a8ff0d 100644 --- a/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs +++ b/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs @@ -1,11 +1,11 @@ use hir::{db::ExpandDatabase, HasSource, HirDisplay}; +use ide_db::text_edit::TextRange; use ide_db::{ assists::{Assist, AssistId, AssistKind}, label::Label, source_change::SourceChangeBuilder, }; use syntax::ToSmolStr; -use ide_db::text_edit::TextRange; use crate::{Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/type_mismatch.rs b/crates/ide-diagnostics/src/handlers/type_mismatch.rs index f0d8cb3eed..93fe9374a3 100644 --- a/crates/ide-diagnostics/src/handlers/type_mismatch.rs +++ b/crates/ide-diagnostics/src/handlers/type_mismatch.rs @@ -1,5 +1,6 @@ use either::Either; use hir::{db::ExpandDatabase, ClosureStyle, HirDisplay, HirFileIdExt, InFile, Type}; +use ide_db::text_edit::TextEdit; use ide_db::{famous_defs::FamousDefs, source_change::SourceChange}; use syntax::{ ast::{ @@ -9,7 +10,6 @@ use syntax::{ }, AstNode, AstPtr, TextSize, }; -use ide_db::text_edit::TextEdit; use crate::{adjusted_display_range, fix, Assist, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/typed_hole.rs b/crates/ide-diagnostics/src/handlers/typed_hole.rs index cbb187cfa0..3ad84f7bda 100644 --- a/crates/ide-diagnostics/src/handlers/typed_hole.rs +++ b/crates/ide-diagnostics/src/handlers/typed_hole.rs @@ -3,13 +3,13 @@ use hir::{ term_search::{term_search, TermSearchConfig, TermSearchCtx}, ClosureStyle, HirDisplay, ImportPathConfig, }; +use ide_db::text_edit::TextEdit; use ide_db::{ assists::{Assist, AssistId, AssistKind, GroupLabel}, label::Label, source_change::SourceChange, }; use itertools::Itertools; -use ide_db::text_edit::TextEdit; use crate::{Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/unlinked_file.rs b/crates/ide-diagnostics/src/handlers/unlinked_file.rs index 4ceb4089d8..13591dfb2e 100644 --- a/crates/ide-diagnostics/src/handlers/unlinked_file.rs +++ b/crates/ide-diagnostics/src/handlers/unlinked_file.rs @@ -3,6 +3,7 @@ use std::iter; use hir::{db::DefDatabase, DefMap, InFile, ModuleSource}; +use ide_db::text_edit::TextEdit; use ide_db::{ base_db::{FileLoader, SourceDatabase, SourceRootDatabase}, source_change::SourceChange, @@ -13,7 +14,6 @@ use syntax::{ ast::{self, edit::IndentLevel, HasModuleItem, HasName}, AstNode, TextRange, }; -use ide_db::text_edit::TextEdit; use crate::{fix, Assist, Diagnostic, DiagnosticCode, DiagnosticsContext, Severity}; diff --git a/crates/ide-diagnostics/src/handlers/unresolved_field.rs b/crates/ide-diagnostics/src/handlers/unresolved_field.rs index d879f98223..656bedff1a 100644 --- a/crates/ide-diagnostics/src/handlers/unresolved_field.rs +++ b/crates/ide-diagnostics/src/handlers/unresolved_field.rs @@ -1,6 +1,7 @@ use std::iter; use hir::{db::ExpandDatabase, Adt, FileRange, HasSource, HirDisplay, InFile, Struct, Union}; +use ide_db::text_edit::TextEdit; use ide_db::{ assists::{Assist, AssistId, AssistKind}, helpers::is_editable_crate, @@ -16,7 +17,6 @@ use syntax::{ ast::{edit::AstNodeEdit, Type}, SyntaxNode, }; -use ide_db::text_edit::TextEdit; use crate::{adjusted_display_range, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/unresolved_method.rs b/crates/ide-diagnostics/src/handlers/unresolved_method.rs index eb0e83ed3c..81cb452121 100644 --- a/crates/ide-diagnostics/src/handlers/unresolved_method.rs +++ b/crates/ide-diagnostics/src/handlers/unresolved_method.rs @@ -1,4 +1,5 @@ use hir::{db::ExpandDatabase, AssocItem, FileRange, HirDisplay, InFile}; +use ide_db::text_edit::TextEdit; use ide_db::{ assists::{Assist, AssistId, AssistKind}, label::Label, @@ -8,7 +9,6 @@ use syntax::{ ast::{self, make, HasArgList}, format_smolstr, AstNode, SmolStr, TextRange, ToSmolStr, }; -use ide_db::text_edit::TextEdit; use crate::{adjusted_display_range, Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide-diagnostics/src/handlers/unused_variables.rs b/crates/ide-diagnostics/src/handlers/unused_variables.rs index 8712f2f46f..67ece56694 100644 --- a/crates/ide-diagnostics/src/handlers/unused_variables.rs +++ b/crates/ide-diagnostics/src/handlers/unused_variables.rs @@ -1,4 +1,5 @@ use hir::Name; +use ide_db::text_edit::TextEdit; use ide_db::{ assists::{Assist, AssistId, AssistKind}, label::Label, @@ -6,7 +7,6 @@ use ide_db::{ FileRange, RootDatabase, }; use syntax::{Edition, TextRange}; -use ide_db::text_edit::TextEdit; use crate::{Diagnostic, DiagnosticCode, DiagnosticsContext}; diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 512b58b27e..c58ca0f01c 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -8,6 +8,7 @@ use hir::{ sym, ClosureStyle, HasVisibility, HirDisplay, HirDisplayError, HirWrite, ModuleDef, ModuleDefId, Semantics, }; +use ide_db::text_edit::TextEdit; use ide_db::{famous_defs::FamousDefs, FileRange, RootDatabase}; use itertools::Itertools; use smallvec::{smallvec, SmallVec}; @@ -17,7 +18,6 @@ use syntax::{ ast::{self, AstNode, HasGenericParams}, format_smolstr, match_ast, SmolStr, SyntaxNode, TextRange, TextSize, WalkEvent, }; -use ide_db::text_edit::TextEdit; use crate::{navigation_target::TryToNav, FileId}; diff --git a/crates/ide/src/inlay_hints/adjustment.rs b/crates/ide/src/inlay_hints/adjustment.rs index 9b928060c8..4d7d6e270e 100644 --- a/crates/ide/src/inlay_hints/adjustment.rs +++ b/crates/ide/src/inlay_hints/adjustment.rs @@ -11,13 +11,13 @@ use hir::{ }; use ide_db::famous_defs::FamousDefs; +use ide_db::text_edit::TextEditBuilder; use span::EditionedFileId; use stdx::never; use syntax::{ ast::{self, make, AstNode}, ted, }; -use ide_db::text_edit::TextEditBuilder; use crate::{ AdjustmentHints, AdjustmentHintsMode, InlayHint, InlayHintLabel, InlayHintLabelPart, diff --git a/crates/ide/src/inlay_hints/binding_mode.rs b/crates/ide/src/inlay_hints/binding_mode.rs index 319c76d8e0..cfe8657fd0 100644 --- a/crates/ide/src/inlay_hints/binding_mode.rs +++ b/crates/ide/src/inlay_hints/binding_mode.rs @@ -7,9 +7,9 @@ use std::mem; use hir::Mutability; use ide_db::famous_defs::FamousDefs; +use ide_db::text_edit::TextEditBuilder; use span::EditionedFileId; use syntax::ast::{self, AstNode}; -use ide_db::text_edit::TextEditBuilder; use crate::{InlayHint, InlayHintLabel, InlayHintPosition, InlayHintsConfig, InlayKind}; diff --git a/crates/ide/src/inlay_hints/closure_captures.rs b/crates/ide/src/inlay_hints/closure_captures.rs index 57874d8d3d..906f2acf0c 100644 --- a/crates/ide/src/inlay_hints/closure_captures.rs +++ b/crates/ide/src/inlay_hints/closure_captures.rs @@ -2,10 +2,10 @@ //! //! Tests live in [`bind_pat`][super::bind_pat] module. use ide_db::famous_defs::FamousDefs; +use ide_db::text_edit::{TextRange, TextSize}; use span::EditionedFileId; use stdx::{never, TupleExt}; use syntax::ast::{self, AstNode}; -use ide_db::text_edit::{TextRange, TextSize}; use crate::{ InlayHint, InlayHintLabel, InlayHintLabelPart, InlayHintPosition, InlayHintsConfig, InlayKind, diff --git a/crates/ide/src/inlay_hints/discriminant.rs b/crates/ide/src/inlay_hints/discriminant.rs index 584caf7f4b..cd77c3ec3e 100644 --- a/crates/ide/src/inlay_hints/discriminant.rs +++ b/crates/ide/src/inlay_hints/discriminant.rs @@ -5,10 +5,10 @@ //! } //! ``` use hir::Semantics; +use ide_db::text_edit::TextEdit; use ide_db::{famous_defs::FamousDefs, RootDatabase}; use span::EditionedFileId; use syntax::ast::{self, AstNode, HasName}; -use ide_db::text_edit::TextEdit; use crate::{ DiscriminantHints, InlayHint, InlayHintLabel, InlayHintPosition, InlayHintsConfig, InlayKind, diff --git a/crates/ide/src/inlay_hints/implicit_static.rs b/crates/ide/src/inlay_hints/implicit_static.rs index 7ef01f386d..1560df37d0 100644 --- a/crates/ide/src/inlay_hints/implicit_static.rs +++ b/crates/ide/src/inlay_hints/implicit_static.rs @@ -4,12 +4,12 @@ //! ``` use either::Either; use ide_db::famous_defs::FamousDefs; +use ide_db::text_edit::TextEdit; use span::EditionedFileId; use syntax::{ ast::{self, AstNode}, SyntaxKind, }; -use ide_db::text_edit::TextEdit; use crate::{InlayHint, InlayHintPosition, InlayHintsConfig, InlayKind, LifetimeElisionHints}; diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index bac5bd8f03..d053c4b3c9 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -122,6 +122,7 @@ pub use ide_completion::{ CallableSnippets, CompletionConfig, CompletionFieldsToResolve, CompletionItem, CompletionItemKind, CompletionRelevance, Snippet, SnippetScope, }; +pub use ide_db::text_edit::{Indel, TextEdit}; pub use ide_db::{ base_db::{Cancelled, CrateGraph, CrateId, FileChange, SourceRoot, SourceRootId}, documentation::Documentation, @@ -139,7 +140,6 @@ pub use ide_diagnostics::{ pub use ide_ssr::SsrError; pub use span::Edition; pub use syntax::{TextRange, TextSize}; -pub use ide_db::text_edit::{Indel, TextEdit}; pub type Cancellable = Result;