From 798f43da502e4b8d52e9b907420708d956faa054 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 17 Jul 2020 15:44:37 +0200 Subject: Fix out of bounds panic in active parameter --- crates/ra_ide/src/completion/presentation.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crates/ra_ide/src/completion/presentation.rs') 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 @@ -1159,6 +1159,22 @@ fn go(world: &WorldSnapshot) { go(w<|>) } ); } + #[test] + fn too_many_arguments() { + mark::check!(too_many_arguments); + check_scores( + r#" +struct Foo; +fn f(foo: &Foo) { f(foo, w<|>) } +"#, + expect![[r#" + st Foo [] + fn f(…) [] + bn foo [] + "#]], + ); + } + #[test] fn guesses_macro_braces() { check_edit( -- cgit v1.2.3