From 4100824a3e1ad45c4be6bb887ed06cc1ee29d2ca Mon Sep 17 00:00:00 2001 From: Mikhail Golubev Date: Mon, 10 Sep 2018 19:12:33 +0300 Subject: [PATCH] PY-31442 Restore functioning of Join Lines for f-strings It's not able to handle more complex cases yet, though. Say, if we want to join plain and formatted strings literals. --- .../python/editor/PyJoinLinesHandler.java | 75 ++++++++++--------- .../joinLines/FStringAndPlainLiteral-after.py | 1 + .../joinLines/FStringAndPlainLiteral.py | 2 + python/testData/joinLines/FStrings-after.py | 1 + python/testData/joinLines/FStrings.py | 2 + .../com/jetbrains/python/PyJoinLinesTest.java | 8 ++ 6 files changed, 52 insertions(+), 37 deletions(-) create mode 100644 python/testData/joinLines/FStringAndPlainLiteral-after.py create mode 100644 python/testData/joinLines/FStringAndPlainLiteral.py create mode 100644 python/testData/joinLines/FStrings-after.py create mode 100644 python/testData/joinLines/FStrings.py diff --git a/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java b/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java index e3629be66f51..1e84eec16de0 100644 --- a/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java +++ b/python/src/com/jetbrains/python/editor/PyJoinLinesHandler.java @@ -33,8 +33,6 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -import static com.jetbrains.python.psi.PyUtil.StringNodeInfo; - /** * Joins lines sanely. *