Community
Participate
Working Groups
While developing with lots of lambdas and brackets are unbalanced, Eclipse JDT produces an error message for a missing bracket that spans over 4 lines and 20 instructions. This makes it quite hard to remediate the issue. When developing without auto-formatting, my strategy to deal with it is to rely on the formatting to better highlight which blocks have unbalanced brackets. It's useful. However, when a project has format on save, it screws up the manual formatting to something that's much less helpful and making remediation of unbalanced brackets harder to troubleshoot. It would be great if the formatter would be more able to deal with such cases, by at least formatting according to the opening bracket, or fully skipping formatting for blocks which aren't syntaxically correct.
Wouldn't it be better to provide better support to deal with the reported error than tweaking the formatter?
Also, the formatter does skip formatting for any nodes that are marked as malformed. Usually it means whole methods that contain any syntax error. Can you give an example of a malformed code that gets formatted?