diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_scope.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_scope.rs | 29 |
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( |