aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
authorice1000 <[email protected]>2019-10-08 12:25:37 +0100
committerice1000 <[email protected]>2019-10-08 12:32:41 +0100
commitb043358be936b7f139efd49b7d187d64e319830e (patch)
tree0d97b8dbff3a9f7052aea71a904ca5055176d16c /crates/ra_ide_api/src/completion
parent6bad638928ab880bfbad868f07f0690ace2f2c30 (diff)
Address comments: fix docs, add completion test for `Self`.
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/complete_scope.rs29
1 files changed, 29 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 515a6285c..38a6c3d37 100644
--- a/crates/ra_ide_api/src/completion/complete_scope.rs
+++ b/crates/ra_ide_api/src/completion/complete_scope.rs
@@ -310,6 +310,35 @@ mod tests {
310 } 310 }
311 311
312 #[test] 312 #[test]
313 fn completes_self_in_enum() {
314 assert_debug_snapshot!(
315 do_reference_completion(
316 r"
317 enum X {
318 Y(<|>)
319 }
320 "
321 ),
322 @r###"[
323 CompletionItem {
324 label: "Self",
325 source_range: [48; 48),
326 delete: [48; 48),
327 insert: "Self",
328 kind: TypeParam,
329 },
330 CompletionItem {
331 label: "X",
332 source_range: [48; 48),
333 delete: [48; 48),
334 insert: "X",
335 kind: Enum,
336 },
337]"###
338 );
339 }
340
341 #[test]
313 fn completes_module_items() { 342 fn completes_module_items() {
314 assert_debug_snapshot!( 343 assert_debug_snapshot!(
315 do_reference_completion( 344 do_reference_completion(