Skip to content

Commit 6c23e43

Browse files
authored
Handle white spaces for list along with dictionary (microsoft#22209)
Legacy normalization script leaves unnecessary white spaces for dictionary as well as list. While there are multiple correct usage of it such as for after a function, for more intuitive REPL experience. We want to keep previous normalization style and white space format EXCEPT for dictionary and list case. Dictionary case is handled, but this is the PR to handle the elimination of extra white spaces for list as well. Closes: microsoft#22208
1 parent ec001a0 commit 6c23e43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pythonFiles/normalizeSelection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def normalize_lines(selection):
119119

120120
# Insert a newline between each top-level statement, and append a newline to the selection.
121121
source = "\n".join(statements) + "\n"
122-
if selection[-2] == "}":
122+
if selection[-2] == "}" or selection[-2] == "]":
123123
source = source[:-1]
124124
except Exception:
125125
# If there's a problem when parsing statements,

0 commit comments

Comments
 (0)