diff --git a/plugins/kotlin/idea/tests/testData/refactoring/extractFunctionInplace/DontSkipWhitespacesBefore.after.kt b/plugins/kotlin/idea/tests/testData/refactoring/extractFunctionInplace/DontSkipWhitespacesBefore.after.kt new file mode 100644 index 000000000000..487072c408af --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/refactoring/extractFunctionInplace/DontSkipWhitespacesBefore.after.kt @@ -0,0 +1,8 @@ +fun testFun(x: Any): Unit { + println(x) + extracted() +} + +private fun extracted() { + println("that's something else") +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/refactoring/extractFunctionInplace/DontSkipWhitespacesBefore.kt b/plugins/kotlin/idea/tests/testData/refactoring/extractFunctionInplace/DontSkipWhitespacesBefore.kt new file mode 100644 index 000000000000..a932d2d6fae4 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/refactoring/extractFunctionInplace/DontSkipWhitespacesBefore.kt @@ -0,0 +1,4 @@ +fun testFun(x: Any): Unit { + println(x) + println("that's something else") +} \ No newline at end of file diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractFunction/AbstractInplaceExtractionHelper.kt b/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractFunction/AbstractInplaceExtractionHelper.kt index 4de6fa169bfc..51a5dcb7553d 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractFunction/AbstractInplaceExtractionHelper.kt +++ b/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractFunction/AbstractInplaceExtractionHelper.kt @@ -11,6 +11,7 @@ import com.intellij.openapi.keymap.KeymapUtil import com.intellij.openapi.project.Project import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.TextRange +import com.intellij.psi.PsiComment import com.intellij.psi.PsiElement import com.intellij.psi.SmartPointerManager import com.intellij.psi.util.PsiTreeUtil @@ -61,7 +62,7 @@ interface AbstractInplaceExtractionHelper