]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide_completion/src/completions/fn_param.rs
feat: improve parser error recovery for function parameters
[rust.git] / crates / ide_completion / src / completions / fn_param.rs
index 7805da24abd6681ec834f8b1510582ea622514a6..d299f2e2634ae6c913ed0e372eca156babbe02b1 100644 (file)
@@ -101,6 +101,20 @@ fn baz(file$0) {}
         );
     }
 
+    #[test]
+    fn test_param_completion_first_param() {
+        check(
+            r#"
+fn foo(file_id: FileId) {}
+fn bar(file_id: FileId) {}
+fn baz(file$0 id: u32) {}
+"#,
+            expect![[r#"
+                bn file_id: FileId
+            "#]],
+        );
+    }
+
     #[test]
     fn test_param_completion_nth_param() {
         check(