Closed Machine-Maker closed 2 months ago
Fixed by #362, thank you for the report!
I guess it technically fixed the one I listed in the issue, but there are still tons of other cases of extra spaces on blank lines. I'll open a new report with as many cases as I can find that seem different.
I think it'll be okay to re-use this one. I'll reopen it, feel free to add the new cases here.
Well actually, intellij has this handy export findings to txt file. So here is all of the offenders in the mc source. I searched for ^\s\s\s\s*$
.
This test case reproduces the issue:
static {
takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(// 13
() -> {
for (int i = 0; i < 10; i++) {// 14
System.out.println(i);// 15
}
if (new Random().nextBoolean()) {// 17
System.out.println(true);// 18
}
}// 20
);
}// 21
static void takeLambda00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000(Runnable r) {
}
The issue is basically that the lambda argument's indent is being appended to blank lines in the lambda. Also worth noting the issue goes away when the method name is changed to be reasonable and the formatter no longer needs to add indent.
Vineflower version
1.11.0-20240406.040032-5
Describe the bug
Some files seem to have spaces on blank lines.
Additional information
There are tons of examples, you can just do a fresh decompile of Minecraft and to a regex search for lines that only contain spaces. This is an example from
net.minecraft.data.recipes.RecipeProvider
.