diff options
author | Aleksey Kladov <[email protected]> | 2019-02-11 12:39:26 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-11 12:41:39 +0000 |
commit | 58ed8ee6650058d5dc4ce511e2d9c04fdfa09aaf (patch) | |
tree | 1a45d04e9cef82dd57967e99e9af9b923a193836 /crates/ra_ide_api/src/completion | |
parent | 2babbbb97800b526cc29f244bb6ea58b213d24f3 (diff) |
use extern prelude in Resolver
This fixes two bugs:
- completion for paths works again
- we handle extern prelude shadowing more correctly
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-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 | ] | ||