aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r--crates/ide/src/lib.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index 0511efae3..9db387d26 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -24,7 +24,6 @@ mod display;
24 24
25mod annotations; 25mod annotations;
26mod call_hierarchy; 26mod call_hierarchy;
27mod diagnostics;
28mod expand_macro; 27mod expand_macro;
29mod extend_selection; 28mod extend_selection;
30mod file_structure; 29mod file_structure;
@@ -40,6 +39,7 @@ mod matching_brace;
40mod move_item; 39mod move_item;
41mod parent_module; 40mod parent_module;
42mod references; 41mod references;
42mod rename;
43mod fn_references; 43mod fn_references;
44mod runnables; 44mod runnables;
45mod ssr; 45mod ssr;
@@ -71,7 +71,6 @@ use crate::display::ToNav;
71pub use crate::{ 71pub use crate::{
72 annotations::{Annotation, AnnotationConfig, AnnotationKind}, 72 annotations::{Annotation, AnnotationConfig, AnnotationKind},
73 call_hierarchy::CallItem, 73 call_hierarchy::CallItem,
74 diagnostics::{Diagnostic, DiagnosticsConfig, Severity},
75 display::navigation_target::NavigationTarget, 74 display::navigation_target::NavigationTarget,
76 expand_macro::ExpandedMacro, 75 expand_macro::ExpandedMacro,
77 file_structure::{StructureNode, StructureNodeKind}, 76 file_structure::{StructureNode, StructureNodeKind},
@@ -81,7 +80,8 @@ pub use crate::{
81 markup::Markup, 80 markup::Markup,
82 move_item::Direction, 81 move_item::Direction,
83 prime_caches::PrimeCachesProgress, 82 prime_caches::PrimeCachesProgress,
84 references::{rename::RenameError, ReferenceSearchResult}, 83 references::ReferenceSearchResult,
84 rename::RenameError,
85 runnables::{Runnable, RunnableKind, TestId}, 85 runnables::{Runnable, RunnableKind, TestId},
86 syntax_highlighting::{ 86 syntax_highlighting::{
87 tags::{Highlight, HlMod, HlMods, HlOperator, HlPunct, HlTag}, 87 tags::{Highlight, HlMod, HlMods, HlOperator, HlPunct, HlTag},
@@ -109,6 +109,7 @@ pub use ide_db::{
109 symbol_index::Query, 109 symbol_index::Query,
110 RootDatabase, SymbolKind, 110 RootDatabase, SymbolKind,
111}; 111};
112pub use ide_diagnostics::{Diagnostic, DiagnosticsConfig, Severity};
112pub use ide_ssr::SsrError; 113pub use ide_ssr::SsrError;
113pub use syntax::{TextRange, TextSize}; 114pub use syntax::{TextRange, TextSize};
114pub use text_edit::{Indel, TextEdit}; 115pub use text_edit::{Indel, TextEdit};
@@ -536,7 +537,7 @@ impl Analysis {
536 ) -> Cancellable<Vec<Assist>> { 537 ) -> Cancellable<Vec<Assist>> {
537 self.with_db(|db| { 538 self.with_db(|db| {
538 let ssr_assists = ssr::ssr_assists(db, &resolve, frange); 539 let ssr_assists = ssr::ssr_assists(db, &resolve, frange);
539 let mut acc = Assist::get(db, config, resolve, frange); 540 let mut acc = ide_assists::assists(db, config, resolve, frange);
540 acc.extend(ssr_assists.into_iter()); 541 acc.extend(ssr_assists.into_iter());
541 acc 542 acc
542 }) 543 })
@@ -549,7 +550,7 @@ impl Analysis {
549 resolve: AssistResolveStrategy, 550 resolve: AssistResolveStrategy,
550 file_id: FileId, 551 file_id: FileId,
551 ) -> Cancellable<Vec<Diagnostic>> { 552 ) -> Cancellable<Vec<Diagnostic>> {
552 self.with_db(|db| diagnostics::diagnostics(db, config, &resolve, file_id)) 553 self.with_db(|db| ide_diagnostics::diagnostics(db, config, &resolve, file_id))
553 } 554 }
554 555
555 /// Convenience function to return assists + quick fixes for diagnostics 556 /// Convenience function to return assists + quick fixes for diagnostics
@@ -568,7 +569,7 @@ impl Analysis {
568 self.with_db(|db| { 569 self.with_db(|db| {
569 let ssr_assists = ssr::ssr_assists(db, &resolve, frange); 570 let ssr_assists = ssr::ssr_assists(db, &resolve, frange);
570 let diagnostic_assists = if include_fixes { 571 let diagnostic_assists = if include_fixes {
571 diagnostics::diagnostics(db, diagnostics_config, &resolve, frange.file_id) 572 ide_diagnostics::diagnostics(db, diagnostics_config, &resolve, frange.file_id)
572 .into_iter() 573 .into_iter()
573 .flat_map(|it| it.fixes.unwrap_or_default()) 574 .flat_map(|it| it.fixes.unwrap_or_default())
574 .filter(|it| it.target.intersect(frange.range).is_some()) 575 .filter(|it| it.target.intersect(frange.range).is_some())
@@ -577,7 +578,7 @@ impl Analysis {
577 Vec::new() 578 Vec::new()
578 }; 579 };
579 580
580 let mut res = Assist::get(db, assist_config, resolve, frange); 581 let mut res = ide_assists::assists(db, assist_config, resolve, frange);
581 res.extend(ssr_assists.into_iter()); 582 res.extend(ssr_assists.into_iter());
582 res.extend(diagnostic_assists.into_iter()); 583 res.extend(diagnostic_assists.into_iter());
583 584
@@ -592,14 +593,14 @@ impl Analysis {
592 position: FilePosition, 593 position: FilePosition,
593 new_name: &str, 594 new_name: &str,
594 ) -> Cancellable<Result<SourceChange, RenameError>> { 595 ) -> Cancellable<Result<SourceChange, RenameError>> {
595 self.with_db(|db| references::rename::rename(db, position, new_name)) 596 self.with_db(|db| rename::rename(db, position, new_name))
596 } 597 }
597 598
598 pub fn prepare_rename( 599 pub fn prepare_rename(
599 &self, 600 &self,
600 position: FilePosition, 601 position: FilePosition,
601 ) -> Cancellable<Result<RangeInfo<()>, RenameError>> { 602 ) -> Cancellable<Result<RangeInfo<()>, RenameError>> {
602 self.with_db(|db| references::rename::prepare_rename(db, position)) 603 self.with_db(|db| rename::prepare_rename(db, position))
603 } 604 }
604 605
605 pub fn will_rename_file( 606 pub fn will_rename_file(
@@ -607,7 +608,7 @@ impl Analysis {
607 file_id: FileId, 608 file_id: FileId,
608 new_name_stem: &str, 609 new_name_stem: &str,
609 ) -> Cancellable<Option<SourceChange>> { 610 ) -> Cancellable<Option<SourceChange>> {
610 self.with_db(|db| references::rename::will_rename_file(db, file_id, new_name_stem)) 611 self.with_db(|db| rename::will_rename_file(db, file_id, new_name_stem))
611 } 612 }
612 613
613 pub fn structural_search_replace( 614 pub fn structural_search_replace(