diff options
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r-- | crates/ide/src/lib.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index f8d69382e..567b8117e 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -86,18 +86,15 @@ pub use completion::{ | |||
86 | InsertTextFormat, | 86 | InsertTextFormat, |
87 | }; | 87 | }; |
88 | pub use hir::{Documentation, Semantics}; | 88 | pub use hir::{Documentation, Semantics}; |
89 | pub use ide_db::base_db::{ | ||
90 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, | ||
91 | SourceRootId, | ||
92 | }; | ||
93 | pub use ide_db::{ | 89 | pub use ide_db::{ |
90 | base_db::{ | ||
91 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, | ||
92 | SourceRoot, SourceRootId, | ||
93 | }, | ||
94 | call_info::CallInfo, | 94 | call_info::CallInfo, |
95 | search::{FileReference, ReferenceAccess, ReferenceKind}, | ||
96 | }; | ||
97 | pub use ide_db::{ | ||
98 | label::Label, | 95 | label::Label, |
99 | line_index::{LineCol, LineIndex}, | 96 | line_index::{LineCol, LineIndex}, |
100 | search::SearchScope, | 97 | search::{FileReference, ReferenceAccess, ReferenceKind, SearchScope}, |
101 | source_change::{FileSystemEdit, SourceChange}, | 98 | source_change::{FileSystemEdit, SourceChange}, |
102 | symbol_index::Query, | 99 | symbol_index::Query, |
103 | RootDatabase, | 100 | RootDatabase, |
@@ -372,9 +369,7 @@ impl Analysis { | |||
372 | position: FilePosition, | 369 | position: FilePosition, |
373 | search_scope: Option<SearchScope>, | 370 | search_scope: Option<SearchScope>, |
374 | ) -> Cancelable<Option<ReferenceSearchResult>> { | 371 | ) -> Cancelable<Option<ReferenceSearchResult>> { |
375 | self.with_db(|db| { | 372 | self.with_db(|db| references::find_all_refs(&Semantics::new(db), position, search_scope)) |
376 | references::find_all_refs(&Semantics::new(db), position, search_scope).map(|it| it.info) | ||
377 | }) | ||
378 | } | 373 | } |
379 | 374 | ||
380 | /// Finds all methods and free functions for the file. Does not return tests! | 375 | /// Finds all methods and free functions for the file. Does not return tests! |
@@ -481,6 +476,7 @@ impl Analysis { | |||
481 | position: FilePosition, | 476 | position: FilePosition, |
482 | full_import_path: &str, | 477 | full_import_path: &str, |
483 | imported_name: String, | 478 | imported_name: String, |
479 | import_for_trait_assoc_item: bool, | ||
484 | ) -> Cancelable<Vec<TextEdit>> { | 480 | ) -> Cancelable<Vec<TextEdit>> { |
485 | Ok(self | 481 | Ok(self |
486 | .with_db(|db| { | 482 | .with_db(|db| { |
@@ -490,6 +486,7 @@ impl Analysis { | |||
490 | position, | 486 | position, |
491 | full_import_path, | 487 | full_import_path, |
492 | imported_name, | 488 | imported_name, |
489 | import_for_trait_assoc_item, | ||
493 | ) | 490 | ) |
494 | })? | 491 | })? |
495 | .unwrap_or_default()) | 492 | .unwrap_or_default()) |
@@ -523,7 +520,7 @@ impl Analysis { | |||
523 | &self, | 520 | &self, |
524 | position: FilePosition, | 521 | position: FilePosition, |
525 | new_name: &str, | 522 | new_name: &str, |
526 | ) -> Cancelable<Result<RangeInfo<SourceChange>, RenameError>> { | 523 | ) -> Cancelable<Result<SourceChange, RenameError>> { |
527 | self.with_db(|db| references::rename::rename(db, position, new_name)) | 524 | self.with_db(|db| references::rename::rename(db, position, new_name)) |
528 | } | 525 | } |
529 | 526 | ||