From b043358be936b7f139efd49b7d187d64e319830e Mon Sep 17 00:00:00 2001 From: ice1000 Date: Tue, 8 Oct 2019 07:25:37 -0400 Subject: Address comments: fix docs, add completion test for `Self`. --- crates/ra_ide_api/src/completion/complete_scope.rs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/ra_ide_api') 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 @@ -309,6 +309,35 @@ mod tests { ); } + #[test] + fn completes_self_in_enum() { + assert_debug_snapshot!( + do_reference_completion( + r" + enum X { + Y(<|>) + } + " + ), + @r###"[ + CompletionItem { + label: "Self", + source_range: [48; 48), + delete: [48; 48), + insert: "Self", + kind: TypeParam, + }, + CompletionItem { + label: "X", + source_range: [48; 48), + delete: [48; 48), + insert: "X", + kind: Enum, + }, +]"### + ); + } + #[test] fn completes_module_items() { assert_debug_snapshot!( -- cgit v1.2.3