diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtPrimaryConstructor.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtPrimaryConstructor.kt index ab3a20b966a..e283b19572f 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtPrimaryConstructor.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtPrimaryConstructor.kt @@ -61,7 +61,7 @@ class KtPrimaryConstructor : KtConstructor { override fun removeModifier(modifier: KtModifierKeywordToken) { super.removeModifier(modifier) if (modifierList == null) { - getConstructorKeyword()?.delete() + removeRedundantConstructorKeywordAndSpace() } } diff --git a/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt b/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt index 6cd8d40f7c9..6ac16094556 100644 --- a/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt +++ b/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt @@ -1,2 +1,2 @@ // INTENTION_TEXT: Make public -class C private constructor(val v: Int) \ No newline at end of file +class C private constructor(val /* check no reformat here */ v: Int) \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt.after b/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt.after index dd015ae32e1..a7ce98aac79 100644 --- a/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt.after +++ b/idea/testData/intentions/changeVisibility/public/primaryConstructor.kt.after @@ -1,2 +1,2 @@ // INTENTION_TEXT: Make public -class C (val v: Int) \ No newline at end of file +class C(val /* check no reformat here */ v: Int) \ No newline at end of file diff --git a/idea/testData/refactoring/changeSignature/ConstructorAfter.kt b/idea/testData/refactoring/changeSignature/ConstructorAfter.kt index 2ad049f63c5..4a95d979185 100644 --- a/idea/testData/refactoring/changeSignature/ConstructorAfter.kt +++ b/idea/testData/refactoring/changeSignature/ConstructorAfter.kt @@ -1,6 +1,6 @@ open class C0(val x: Any?) {} -open class C1 (var _x1: Int = 1, _x2: Float?, val _x3: ((Int) -> Int)?) : C0(_x3){ +open class C1(var _x1: Int = 1, _x2: Float?, val _x3: ((Int) -> Int)?) : C0(_x3){ fun bar() { val y1 = _x1; val y2 = _x2; diff --git a/idea/testData/refactoring/changeSignature/GenericConstructorAfter.kt b/idea/testData/refactoring/changeSignature/GenericConstructorAfter.kt index b19fe20b3d9..f3fb0e22a08 100644 --- a/idea/testData/refactoring/changeSignature/GenericConstructorAfter.kt +++ b/idea/testData/refactoring/changeSignature/GenericConstructorAfter.kt @@ -1,6 +1,6 @@ open class C0(val x: X) {} -open class C1 (var _x1: T? = null, _x2: Double?, val _x3: ((Int) -> Int)?) : C0<((Int) -> Int)?>(_x3){ +open class C1(var _x1: T? = null, _x2: Double?, val _x3: ((Int) -> Int)?) : C0<((Int) -> Int)?>(_x3){ fun bar() { val y1 = _x1; val y2 = _x2; diff --git a/idea/testData/refactoring/changeSignature/MakePrimaryConstructorPublicAfter.kt b/idea/testData/refactoring/changeSignature/MakePrimaryConstructorPublicAfter.kt index a01f5fe11c9..da026ec8caf 100644 --- a/idea/testData/refactoring/changeSignature/MakePrimaryConstructorPublicAfter.kt +++ b/idea/testData/refactoring/changeSignature/MakePrimaryConstructorPublicAfter.kt @@ -1 +1 @@ -class X (n: Int) \ No newline at end of file +class X(n: Int) \ No newline at end of file