Formatter: Close empty objects on same line

This commit is contained in:
Gregor Niehl 2023-11-04 13:51:22 +01:00 committed by James Westman
parent 3c424d03a4
commit 703e2626dd
2 changed files with 6 additions and 6 deletions

View file

@ -153,6 +153,9 @@ class Formatter:
current_line = current_line[:-1]
commit_current_line()
current_line = "]"
elif str(last_not_whitespace) in OPENING_TOKENS:
end_str = end_str.strip()
commit_current_line(LineType.BLOCK_CLOSE, True, 0)
indent_levels -= 1
commit_current_line(LineType.BLOCK_CLOSE, True)