javavscode
javavscode copied to clipboard
Formatter destroys code with syntax errors
The formatter seems to have trouble handling code with syntax errors, for example:
if ("foo".contains("bar"))) {
System.out.println("bar");
}
will be formatted to
if ("foo".contains("bar"))
{
}) {
System.out.println("bar");
}
This is especially annoying in larger files, where it may destroy code in the same file that is not inside your view. When you find it out, you often can't easily undo it because you might have been editing the code for a while before noticing the damage.
This is a duplicate of #195 (which itself was filed to reopen the original #65 which was closed as "non-reproducible").
@fvclaus this issue is very specific to erroneous if cases and a fix is provided in latest available version 24.1.2 , please give it a try and let us know.
@naren2605 thanks for looking into this. I am not using this extension anymore, because it had too many issues at the time and didn't provide any benefits over the Red Hat extension