aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-04 21:09:56 +0000
committerFlorian Diebold <[email protected]>2019-02-04 21:09:56 +0000
commit699ce06ac3d857c7d4eaf01c523964f01d1b35f2 (patch)
tree2c977fc1739141b95687f90b4934ac2e74e8b677 /crates/ra_ide_api/src
parentccef48b6c3a04b0104a68a947558994ea3e6a069 (diff)
Complete extern prelude (again)
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/completion/complete_scope.rs14
-rw-r--r--crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap22
2 files changed, 36 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs
index 44514ab2b..8674b1e66 100644
--- a/crates/ra_ide_api/src/completion/complete_scope.rs
+++ b/crates/ra_ide_api/src/completion/complete_scope.rs
@@ -111,6 +111,20 @@ mod tests {
111 } 111 }
112 112
113 #[test] 113 #[test]
114 fn completes_extern_prelude() {
115 check_reference_completion(
116 "extern_prelude",
117 r"
118 //- /lib.rs
119 use <|>;
120
121 //- /other_crate/lib.rs
122 // nothing here
123 ",
124 );
125 }
126
127 #[test]
114 fn completes_module_items_in_nested_modules() { 128 fn completes_module_items_in_nested_modules() {
115 check_reference_completion( 129 check_reference_completion(
116 "module_items_in_nested_modules", 130 "module_items_in_nested_modules",
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap
new file mode 100644
index 000000000..d0e3a6188
--- /dev/null
+++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__extern_prelude.snap
@@ -0,0 +1,22 @@
1---
2created: "2019-02-04T21:08:32.615556587+00:00"
3creator: [email protected]
4expression: kind_completions
5source: crates/ra_ide_api/src/completion/completion_item.rs
6---
7[
8 CompletionItem {
9 completion_kind: Reference,
10 label: "other_crate",
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: [4; 4),
20 text_edit: None
21 }
22]