aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ide_completion/src/completions/flyimport.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs
index c6b83da3d..1ef6f8afb 100644
--- a/crates/ide_completion/src/completions/flyimport.rs
+++ b/crates/ide_completion/src/completions/flyimport.rs
@@ -21,6 +21,45 @@
21//! ``` 21//! ```
22//! 22//!
23//! Also completes associated items, that require trait imports. 23//! Also completes associated items, that require trait imports.
24//! If any unresolved and/or partially-qualified path predeces the input, it will be taken into account: only the items with import string
25//! containing this whole path will be considered and the corresponding path import will be added:
26//!
27//! ```
28//! mod foo {
29//! pub mod bar {
30//! pub struct Item;
31//!
32//! impl Item {
33//! pub const TEST_ASSOC: usize = 3;
34//! }
35//! }
36//! }
37//!
38//! fn main() {
39//! bar::Item::TEST_A$0
40//! }
41//! ```
42//! ->
43//! ```
44//! use foo::bar;
45//!
46//! mod foo {
47//! pub mod bar {
48//! pub struct Item;
49//!
50//! impl Item {
51//! pub const TEST_ASSOC: usize = 3;
52//! }
53//! }
54//! }
55//!
56//! fn main() {
57//! bar::Item::TEST_ASSOC
58//! }
59//! ```
60//!
61//! NOTE: currently, if an assoc item comes from a trait that's not currently imported and it also has an unresolved and/or partially-qualified path,
62//! no imports will be proposed.
24//! 63//!
25//! .Fuzzy search details 64//! .Fuzzy search details
26//! 65//!