aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-17 14:44:37 +0100
committerAleksey Kladov <[email protected]>2020-07-17 14:44:37 +0100
commit798f43da502e4b8d52e9b907420708d956faa054 (patch)
tree8dd4ccf08afb5b1f0576242ba13d1d165c6bb3c3 /crates/ra_ide/src/completion
parent23df3834333a4db1449b2ba52e878ade47d1dfb2 (diff)
Fix out of bounds panic in active parameter
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r--crates/ra_ide/src/completion/presentation.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index c7b74e635..9a94ff476 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -1160,6 +1160,22 @@ fn go(world: &WorldSnapshot) { go(w<|>) }
1160 } 1160 }
1161 1161
1162 #[test] 1162 #[test]
1163 fn too_many_arguments() {
1164 mark::check!(too_many_arguments);
1165 check_scores(
1166 r#"
1167struct Foo;
1168fn f(foo: &Foo) { f(foo, w<|>) }
1169"#,
1170 expect![[r#"
1171 st Foo []
1172 fn f(…) []
1173 bn foo []
1174 "#]],
1175 );
1176 }
1177
1178 #[test]
1163 fn guesses_macro_braces() { 1179 fn guesses_macro_braces() {
1164 check_edit( 1180 check_edit(
1165 "vec!", 1181 "vec!",