Skip to content

Commit 821e836

Browse files
Update the docs
1 parent e214c3a commit 821e836

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

crates/ide_completion/src/completions/flyimport.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,45 @@
2121
//! ```
2222
//!
2323
//! 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.
2463
//!
2564
//! .Fuzzy search details
2665
//!

0 commit comments

Comments
 (0)