From ec31f475ca245746e7fcfb1128ca5e6cc2c6cf05 Mon Sep 17 00:00:00 2001 From: Simon Bihel Date: Tue, 4 Jun 2019 21:26:12 +0100 Subject: Use inline snapshots in complete_keyword --- .../ra_ide_api/src/completion/complete_keyword.rs | 679 ++++++++++++++++++--- ...em__completes_break_and_continue_in_loops1.snap | 57 -- ...em__completes_break_and_continue_in_loops2.snap | 43 -- ...t_add_semi_after_return_if_not_a_statement.snap | 43 -- .../completion_item__keywords_in_function1.snap | 43 -- .../completion_item__keywords_in_function2.snap | 57 -- .../completion_item__keywords_in_function3.snap | 43 -- .../completion_item__keywords_in_function4.snap | 43 -- .../completion_item__keywords_in_use_stmt1.snap | 29 - .../completion_item__keywords_in_use_stmt2.snap | 22 - .../completion_item__keywords_in_use_stmt3.snap | 22 - ...etion_item__last_return_in_block_has_semi1.snap | 43 -- ...etion_item__last_return_in_block_has_semi2.snap | 43 -- ...item__no_semi_after_break_continue_in_expr.snap | 57 -- 14 files changed, 580 insertions(+), 644 deletions(-) delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap delete mode 100644 crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/completion/complete_keyword.rs b/crates/ra_ide_api/src/completion/complete_keyword.rs index 718b83418..cfb9fd6e8 100644 --- a/crates/ra_ide_api/src/completion/complete_keyword.rs +++ b/crates/ra_ide_api/src/completion/complete_keyword.rs @@ -109,159 +109,640 @@ fn complete_return( #[cfg(test)] mod tests { - use crate::completion::{check_completion, CompletionKind}; + use crate::completion::{do_completion, CompletionItem, CompletionKind}; + use insta::assert_debug_snapshot_matches; - fn check_keyword_completion(name: &str, code: &str) { - check_completion(name, code, CompletionKind::Keyword); + fn do_keyword_completion(code: &str) -> Vec { + do_completion(code, CompletionKind::Keyword) } #[test] fn completes_keywords_in_use_stmt() { - check_keyword_completion( - "keywords_in_use_stmt1", - r" - use <|> - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + use <|> + ", + ), + @r###"[ + CompletionItem { + label: "crate", + source_range: [21; 21), + delete: [21; 21), + insert: "crate::", + kind: Keyword, + }, + CompletionItem { + label: "self", + source_range: [21; 21), + delete: [21; 21), + insert: "self", + kind: Keyword, + }, + CompletionItem { + label: "super", + source_range: [21; 21), + delete: [21; 21), + insert: "super::", + kind: Keyword, + }, +]"### ); - check_keyword_completion( - "keywords_in_use_stmt2", - r" - use a::<|> - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + use a::<|> + ", + ), + @r###"[ + CompletionItem { + label: "self", + source_range: [24; 24), + delete: [24; 24), + insert: "self", + kind: Keyword, + }, + CompletionItem { + label: "super", + source_range: [24; 24), + delete: [24; 24), + insert: "super::", + kind: Keyword, + }, +]"### ); - check_keyword_completion( - "keywords_in_use_stmt3", - r" - use a::{b, <|>} - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + use a::{b, <|>} + ", + ), + @r###"[ + CompletionItem { + label: "self", + source_range: [28; 28), + delete: [28; 28), + insert: "self", + kind: Keyword, + }, + CompletionItem { + label: "super", + source_range: [28; 28), + delete: [28; 28), + insert: "super::", + kind: Keyword, + }, +]"### ); } #[test] fn completes_various_keywords_in_function() { - check_keyword_completion( - "keywords_in_function1", - r" - fn quux() { - <|> - } - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() { + <|> + } + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [49; 49), + delete: [49; 49), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [49; 49), + delete: [49; 49), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [49; 49), + delete: [49; 49), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [49; 49), + delete: [49; 49), + insert: "return;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [49; 49), + delete: [49; 49), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); } #[test] fn completes_else_after_if() { - check_keyword_completion( - "keywords_in_function2", - r" - fn quux() { - if true { - () - } <|> - } - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() { + if true { + () + } <|> + } + ", + ), + @r###"[ + CompletionItem { + label: "else", + source_range: [108; 108), + delete: [108; 108), + insert: "else {$0}", + kind: Keyword, + }, + CompletionItem { + label: "else if", + source_range: [108; 108), + delete: [108; 108), + insert: "else if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "if", + source_range: [108; 108), + delete: [108; 108), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [108; 108), + delete: [108; 108), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [108; 108), + delete: [108; 108), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [108; 108), + delete: [108; 108), + insert: "return;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [108; 108), + delete: [108; 108), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); } #[test] fn test_completion_return_value() { - check_keyword_completion( - "keywords_in_function3", - r" - fn quux() -> i32 { - <|> - 92 - } - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() -> i32 { + <|> + 92 + } + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [56; 56), + delete: [56; 56), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [56; 56), + delete: [56; 56), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [56; 56), + delete: [56; 56), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [56; 56), + delete: [56; 56), + insert: "return $0;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [56; 56), + delete: [56; 56), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); - check_keyword_completion( - "keywords_in_function4", - r" - fn quux() { - <|> - 92 - } - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() { + <|> + 92 + } + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [49; 49), + delete: [49; 49), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [49; 49), + delete: [49; 49), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [49; 49), + delete: [49; 49), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [49; 49), + delete: [49; 49), + insert: "return;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [49; 49), + delete: [49; 49), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); } #[test] fn dont_add_semi_after_return_if_not_a_statement() { - check_keyword_completion( - "dont_add_semi_after_return_if_not_a_statement", - r" - fn quux() -> i32 { - match () { - () => <|> + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() -> i32 { + match () { + () => <|> + } } - } - ", + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [97; 97), + delete: [97; 97), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [97; 97), + delete: [97; 97), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [97; 97), + delete: [97; 97), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [97; 97), + delete: [97; 97), + insert: "return $0", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [97; 97), + delete: [97; 97), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); } #[test] fn last_return_in_block_has_semi() { - check_keyword_completion( - "last_return_in_block_has_semi1", - r" - fn quux() -> i32 { - if condition { - <|> + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() -> i32 { + if condition { + <|> + } } - } - ", + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [95; 95), + delete: [95; 95), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [95; 95), + delete: [95; 95), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [95; 95), + delete: [95; 95), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [95; 95), + delete: [95; 95), + insert: "return $0;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [95; 95), + delete: [95; 95), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); - check_keyword_completion( - "last_return_in_block_has_semi2", - r" - fn quux() -> i32 { - if condition { - <|> + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() -> i32 { + if condition { + <|> + } + let x = 92; + x } - let x = 92; - x - } - ", + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [95; 95), + delete: [95; 95), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [95; 95), + delete: [95; 95), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [95; 95), + delete: [95; 95), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [95; 95), + delete: [95; 95), + insert: "return $0;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [95; 95), + delete: [95; 95), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); } #[test] fn completes_break_and_continue_in_loops() { - check_keyword_completion( - "completes_break_and_continue_in_loops1", - r" - fn quux() -> i32 { - loop { <|> } - } - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() -> i32 { + loop { <|> } + } + ", + ), + @r###"[ + CompletionItem { + label: "break", + source_range: [63; 63), + delete: [63; 63), + insert: "break;", + kind: Keyword, + }, + CompletionItem { + label: "continue", + source_range: [63; 63), + delete: [63; 63), + insert: "continue;", + kind: Keyword, + }, + CompletionItem { + label: "if", + source_range: [63; 63), + delete: [63; 63), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [63; 63), + delete: [63; 63), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [63; 63), + delete: [63; 63), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [63; 63), + delete: [63; 63), + insert: "return $0;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [63; 63), + delete: [63; 63), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); // No completion: lambda isolates control flow - check_keyword_completion( - "completes_break_and_continue_in_loops2", - r" - fn quux() -> i32 { - loop { || { <|> } } - } - ", + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn quux() -> i32 { + loop { || { <|> } } + } + ", + ), + @r###"[ + CompletionItem { + label: "if", + source_range: [68; 68), + delete: [68; 68), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [68; 68), + delete: [68; 68), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [68; 68), + delete: [68; 68), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [68; 68), + delete: [68; 68), + insert: "return $0;", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [68; 68), + delete: [68; 68), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ); } #[test] fn no_semi_after_break_continue_in_expr() { - check_keyword_completion( - "no_semi_after_break_continue_in_expr", - r" - fn f() { - loop { - match () { - () => br<|> + assert_debug_snapshot_matches!( + do_keyword_completion( + r" + fn f() { + loop { + match () { + () => br<|> + } } } - } - ", + ", + ), + @r###"[ + CompletionItem { + label: "break", + source_range: [122; 124), + delete: [122; 124), + insert: "break", + kind: Keyword, + }, + CompletionItem { + label: "continue", + source_range: [122; 124), + delete: [122; 124), + insert: "continue", + kind: Keyword, + }, + CompletionItem { + label: "if", + source_range: [122; 124), + delete: [122; 124), + insert: "if $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "loop", + source_range: [122; 124), + delete: [122; 124), + insert: "loop {$0}", + kind: Keyword, + }, + CompletionItem { + label: "match", + source_range: [122; 124), + delete: [122; 124), + insert: "match $0 {}", + kind: Keyword, + }, + CompletionItem { + label: "return", + source_range: [122; 124), + delete: [122; 124), + insert: "return", + kind: Keyword, + }, + CompletionItem { + label: "while", + source_range: [122; 124), + delete: [122; 124), + insert: "while $0 {}", + kind: Keyword, + }, +]"### ) } } diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap deleted file mode 100644 index b6f95c1ff..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops1.snap +++ /dev/null @@ -1,57 +0,0 @@ ---- -created: "2019-05-23T22:23:35.067956470Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "break", - source_range: [55; 55), - delete: [55; 55), - insert: "break;", - kind: Keyword, - }, - CompletionItem { - label: "continue", - source_range: [55; 55), - delete: [55; 55), - insert: "continue;", - kind: Keyword, - }, - CompletionItem { - label: "if", - source_range: [55; 55), - delete: [55; 55), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [55; 55), - delete: [55; 55), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [55; 55), - delete: [55; 55), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [55; 55), - delete: [55; 55), - insert: "return $0;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [55; 55), - delete: [55; 55), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap deleted file mode 100644 index 9b37478ef..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__completes_break_and_continue_in_loops2.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:44:10.859967190Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [60; 60), - delete: [60; 60), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [60; 60), - delete: [60; 60), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [60; 60), - delete: [60; 60), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [60; 60), - delete: [60; 60), - insert: "return $0;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [60; 60), - delete: [60; 60), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap deleted file mode 100644 index 9d320c715..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__dont_add_semi_after_return_if_not_a_statement.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:23:35.081993214Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [85; 85), - delete: [85; 85), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [85; 85), - delete: [85; 85), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [85; 85), - delete: [85; 85), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [85; 85), - delete: [85; 85), - insert: "return $0", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [85; 85), - delete: [85; 85), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap deleted file mode 100644 index 34a44bb70..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function1.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:23:35.075690846Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [41; 41), - delete: [41; 41), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [41; 41), - delete: [41; 41), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [41; 41), - delete: [41; 41), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [41; 41), - delete: [41; 41), - insert: "return;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [41; 41), - delete: [41; 41), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap deleted file mode 100644 index ac744f362..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function2.snap +++ /dev/null @@ -1,57 +0,0 @@ ---- -created: "2019-05-23T22:23:35.068799431Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "else", - source_range: [92; 92), - delete: [92; 92), - insert: "else {$0}", - kind: Keyword, - }, - CompletionItem { - label: "else if", - source_range: [92; 92), - delete: [92; 92), - insert: "else if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "if", - source_range: [92; 92), - delete: [92; 92), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [92; 92), - delete: [92; 92), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [92; 92), - delete: [92; 92), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [92; 92), - delete: [92; 92), - insert: "return;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [92; 92), - delete: [92; 92), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap deleted file mode 100644 index 1098ecf54..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function3.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:23:35.085655258Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [48; 48), - delete: [48; 48), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [48; 48), - delete: [48; 48), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [48; 48), - delete: [48; 48), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [48; 48), - delete: [48; 48), - insert: "return $0;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [48; 48), - delete: [48; 48), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap deleted file mode 100644 index 3c5eca1ba..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_function4.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:44:10.869539856Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [41; 41), - delete: [41; 41), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [41; 41), - delete: [41; 41), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [41; 41), - delete: [41; 41), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [41; 41), - delete: [41; 41), - insert: "return;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [41; 41), - delete: [41; 41), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap deleted file mode 100644 index 71d7e9de8..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt1.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -created: "2019-05-23T22:23:35.066687241Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "crate", - source_range: [17; 17), - delete: [17; 17), - insert: "crate::", - kind: Keyword, - }, - CompletionItem { - label: "self", - source_range: [17; 17), - delete: [17; 17), - insert: "self", - kind: Keyword, - }, - CompletionItem { - label: "super", - source_range: [17; 17), - delete: [17; 17), - insert: "super::", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap deleted file mode 100644 index ad156fb44..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt2.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -created: "2019-05-23T22:44:10.859494330Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "self", - source_range: [20; 20), - delete: [20; 20), - insert: "self", - kind: Keyword, - }, - CompletionItem { - label: "super", - source_range: [20; 20), - delete: [20; 20), - insert: "super::", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap deleted file mode 100644 index e7b11d532..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__keywords_in_use_stmt3.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -created: "2019-05-23T22:44:40.506690279Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "self", - source_range: [24; 24), - delete: [24; 24), - insert: "self", - kind: Keyword, - }, - CompletionItem { - label: "super", - source_range: [24; 24), - delete: [24; 24), - insert: "super::", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap deleted file mode 100644 index e7069dc0c..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi1.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:23:35.082403612Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [83; 83), - delete: [83; 83), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [83; 83), - delete: [83; 83), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [83; 83), - delete: [83; 83), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [83; 83), - delete: [83; 83), - insert: "return $0;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [83; 83), - delete: [83; 83), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap deleted file mode 100644 index 47beb904b..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__last_return_in_block_has_semi2.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -created: "2019-05-23T22:44:10.871868390Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "if", - source_range: [83; 83), - delete: [83; 83), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [83; 83), - delete: [83; 83), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [83; 83), - delete: [83; 83), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [83; 83), - delete: [83; 83), - insert: "return $0;", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [83; 83), - delete: [83; 83), - insert: "while $0 {}", - kind: Keyword, - }, -] diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap deleted file mode 100644 index 22e25fe3d..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__no_semi_after_break_continue_in_expr.snap +++ /dev/null @@ -1,57 +0,0 @@ ---- -created: "2019-05-23T22:23:35.085365816Z" -creator: insta@0.8.1 -source: crates/ra_ide_api/src/completion/completion_item.rs -expression: kind_completions ---- -[ - CompletionItem { - label: "break", - source_range: [106; 108), - delete: [106; 108), - insert: "break", - kind: Keyword, - }, - CompletionItem { - label: "continue", - source_range: [106; 108), - delete: [106; 108), - insert: "continue", - kind: Keyword, - }, - CompletionItem { - label: "if", - source_range: [106; 108), - delete: [106; 108), - insert: "if $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "loop", - source_range: [106; 108), - delete: [106; 108), - insert: "loop {$0}", - kind: Keyword, - }, - CompletionItem { - label: "match", - source_range: [106; 108), - delete: [106; 108), - insert: "match $0 {}", - kind: Keyword, - }, - CompletionItem { - label: "return", - source_range: [106; 108), - delete: [106; 108), - insert: "return", - kind: Keyword, - }, - CompletionItem { - label: "while", - source_range: [106; 108), - delete: [106; 108), - insert: "while $0 {}", - kind: Keyword, - }, -] -- cgit v1.2.3