Closed arieldon closed 8 months ago
I addressed your "must fix" comments. The diagnostics are more flexible now. They do not necessarily report wonky indentation, but they still use indentation to try to track where to place a closing right curly brace. They also still report misleading indentation for if
and else
statements.
I have not tried your suggestion about changing the way we track indentation in Lexer
yet. Diag_Misleading_If_Or_Else_Body_Indentation
also still reports the if
and not the actual misleading indentation.
I'm not able to figure out a heuristic and an implementation for it that doesn't feel complex and hacky. I'm going to close this PR for now. Thank you for your suggestions and help nonetheless.
This set of commits addresses issues #282 and #1113 by tracking whitespace and adding a few new diagnostics. quick-lint will print warnings about mismatched curly brace indentation,
if/else
indentation, and misleading indentation after a bracelessif
.Commit 2379dea modifies a couple existing tests by adding whitespace to them to avoid triggering
Diag_Mismatched_Curly_Indentation
.