Skip to content

Commit

Permalink
Revert "Do not truncate whitespace for multi-line string" (microsoft#…
Browse files Browse the repository at this point in the history
…24096)

Reverts microsoft#23977

Have to revert microsoft#23977
with issue: microsoft#23743 due
to microsoft#24069

Will revisit why microsoft#23743
is breaking if contained inside other top level (in ast term) code
block, and look into how to support
microsoft#23743 without
breaking.
  • Loading branch information
anthonykim1 committed Sep 12, 2024
1 parent 2743f75 commit 23ba76a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
4 changes: 0 additions & 4 deletions python_files/normalizeSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def _get_statements(selection):
This will remove empty newlines around and within the selection, dedent it,
and split it using the result of `ast.parse()`.
"""
if '"""' in selection or "'''" in selection:
yield selection
return

# Remove blank lines within the selection to prevent the REPL from thinking the block is finished.
lines = (line for line in split_lines(selection) if line.strip() != "")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
def add(x, y):
"""
Adds x
to
y
"""
"""Adds x to y"""
# Some comment
return x + y

v = add(1, 7)
print(v)

10 changes: 2 additions & 8 deletions src/test/python_files/terminalExec/sample2_raw.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
def add(x, y):
"""
Adds x
to
y
"""
"""Adds x to y"""
# Some comment

return x + y

v = add(1, 7)
Expand Down

0 comments on commit 23ba76a

Please sign in to comment.