forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(formatter): fix else indentation after comment between if-else (F…
…uelLabs#3785) closes FuelLabs#2649 Added a few test cases with comments in between, including: - single-line comment with overindentation, - multi-line comment with underindentation, - single-line comment, from inline to multiline if-else Updated `get_post_context()` with a better way to format `else` after comment. This is a bit of a hacky fix but since the post-context concept is currently only used for formatting `else` blocks after comment, I was thinking this might tide us through for now (and the test suite passes as well). I wrote a long-form comment explaining what the new get_post_context() does there especially because fixing the off-by-one error with subtracting by 1 is going to look like a hacky solution (and it is, unfortunately) Co-authored-by: Joshua Batty <[email protected]>
- Loading branch information
1 parent
acd4c1e
commit 1c4f3e2
Showing
2 changed files
with
124 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters