aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/tests/generated.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-08 17:28:48 +0100
committerGitHub <[email protected]>2020-06-08 17:28:48 +0100
commit3a7c218fd40c77246c94d28b36b1c567492e5bcb (patch)
treee3408f17dca2872e79e5b76caad89e9722ed47d8 /crates/ra_assists/src/tests/generated.rs
parent38ac331f7dea94581ec687167c92c65b10daf38d (diff)
parent5dda9955380c6214aa5720ad640b76b870aaa556 (diff)
Merge #4576
4576: Add implementation of extract struct from enum variant r=matklad a=mcrakhman Hi guys! I implemented the extraction functionality including modifying multiple files. The only thing I didn't change the cursor position. I've done it with a previous API, but now snippets have been introduced and I need to figure out how to do it. Please bear in mind that I am a newcomer in the rust-analyzer (and also Rust) world, so I tried to implement the feature to the best of my knowledge, but the API is very new to me, so I am very welcome to introducing changes etc. Co-authored-by: Mikhail Rakhmanov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/tests/generated.rs')
-rw-r--r--crates/ra_assists/src/tests/generated.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs
index d17504529..40a223727 100644
--- a/crates/ra_assists/src/tests/generated.rs
+++ b/crates/ra_assists/src/tests/generated.rs
@@ -338,6 +338,21 @@ fn main() {
338} 338}
339 339
340#[test] 340#[test]
341fn doctest_extract_struct_from_enum_variant() {
342 check_doc_test(
343 "extract_struct_from_enum_variant",
344 r#####"
345enum A { <|>One(u32, u32) }
346"#####,
347 r#####"
348struct One(pub u32, pub u32);
349
350enum A { One(One) }
351"#####,
352 )
353}
354
355#[test]
341fn doctest_fill_match_arms() { 356fn doctest_fill_match_arms() {
342 check_doc_test( 357 check_doc_test(
343 "fill_match_arms", 358 "fill_match_arms",