diff --git a/document/_java.learnMoreAboutCleanUps.md b/document/_java.learnMoreAboutCleanUps.md index a6b8e3cbd..36d74d746 100644 --- a/document/_java.learnMoreAboutCleanUps.md +++ b/document/_java.learnMoreAboutCleanUps.md @@ -405,4 +405,30 @@ public class A { Parser a12; } } +``` + +### `removeUnusedLambdaParameters` + +Rename unused lambda parameters, or unused pattern variables to `_`. + +For example: + +```java +J j = (a, b) -> System.out.println(a); + +switch (r) { + case R(_, long l) -> {} + case R r2 -> {} +} +``` + +becomes: + +```java +J j = (a, _) -> System.out.println(a); + +switch (r) { + case R(_, _) -> {} + case R _ -> {} +} ``` \ No newline at end of file diff --git a/package.json b/package.json index f702896ca..8fbaabe8b 100644 --- a/package.json +++ b/package.json @@ -1313,7 +1313,8 @@ "switchExpression", "tryWithResource", "renameFileToType", - "organizeImports" + "organizeImports", + "removeUnusedLambdaParameters" ] }, "default": [