diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 16 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap | 22 |
2 files changed, 38 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index c47a14e9f..39aefdb13 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -186,4 +186,20 @@ mod tests { | |||
186 | ", | 186 | ", |
187 | ); | 187 | ); |
188 | } | 188 | } |
189 | |||
190 | #[test] | ||
191 | fn completes_use_paths_across_crates() { | ||
192 | check_reference_completion( | ||
193 | "completes_use_paths_across_crates", | ||
194 | " | ||
195 | //- /main.rs | ||
196 | use foo::<|>; | ||
197 | |||
198 | //- /foo/lib.rs | ||
199 | pub mod bar { | ||
200 | pub struct S; | ||
201 | } | ||
202 | ", | ||
203 | ); | ||
204 | } | ||
189 | } | 205 | } |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap new file mode 100644 index 000000000..4b40fcf27 --- /dev/null +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_use_paths_across_crates.snap | |||
@@ -0,0 +1,22 @@ | |||
1 | --- | ||
2 | created: "2019-02-11T11:53:02.410665254Z" | ||
3 | creator: [email protected] | ||
4 | source: crates/ra_ide_api/src/completion/completion_item.rs | ||
5 | expression: kind_completions | ||
6 | --- | ||
7 | [ | ||
8 | CompletionItem { | ||
9 | completion_kind: Reference, | ||
10 | label: "bar", | ||
11 | kind: Some( | ||
12 | Module | ||
13 | ), | ||
14 | detail: None, | ||
15 | documentation: None, | ||
16 | lookup: None, | ||
17 | insert_text: None, | ||
18 | insert_text_format: PlainText, | ||
19 | source_range: [9; 9), | ||
20 | text_edit: None | ||
21 | } | ||
22 | ] | ||