diff --git a/idea/src/org/jetbrains/jet/plugin/formatter/kotlinSpacingRules.kt b/idea/src/org/jetbrains/jet/plugin/formatter/kotlinSpacingRules.kt index 14218613092..0af65cab6ea 100644 --- a/idea/src/org/jetbrains/jet/plugin/formatter/kotlinSpacingRules.kt +++ b/idea/src/org/jetbrains/jet/plugin/formatter/kotlinSpacingRules.kt @@ -254,6 +254,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder { inPosition(parent = FINALLY, right = BLOCK).customRule(leftBraceRule()) inPosition(parent = FUN, right = BLOCK).customRule(leftBraceRule()) + inPosition(parent = PROPERTY_ACCESSOR, right = BLOCK).customRule(leftBraceRule()) inPosition(right = CLASS_BODY).customRule(leftBraceRule(blockType = CLASS_BODY)) diff --git a/idea/testData/formatter/SpacesInDeclarations.after.kt b/idea/testData/formatter/SpacesInDeclarations.after.kt index 2ea61610413..ab417040f92 100644 --- a/idea/testData/formatter/SpacesInDeclarations.after.kt +++ b/idea/testData/formatter/SpacesInDeclarations.after.kt @@ -42,7 +42,23 @@ public var Int.extVar1: Int = 122 public var Int.extVar: Int = 1 +//----------------------- +public var varWithAccessors1: Int + get() { + return 1 + } + set (value: Int) { + /**/ + } +public var varWithAccessors2: Int + get() { + 1 + } + set(value: Int) { + /**/ + } +} //----------------------- annotation class A1 diff --git a/idea/testData/formatter/SpacesInDeclarations.kt b/idea/testData/formatter/SpacesInDeclarations.kt index 962b105f08a..a388ec526c7 100644 --- a/idea/testData/formatter/SpacesInDeclarations.kt +++ b/idea/testData/formatter/SpacesInDeclarations.kt @@ -44,6 +44,20 @@ var . extVar : Int = 1 //----------------------- +public var varWithAccessors1:Int + get() { return 1 } + set (value : Int) { /**/ } + +public var varWithAccessors2: Int + get() { + 1 +} + set(value: Int) + { + /**/ + } +} +//----------------------- annotation class A1 annotation class A2 diff --git a/idea/testData/intentions/convertToBlockBody/getter.kt.after b/idea/testData/intentions/convertToBlockBody/getter.kt.after index 940c7565002..7249e365513 100644 --- a/idea/testData/intentions/convertToBlockBody/getter.kt.after +++ b/idea/testData/intentions/convertToBlockBody/getter.kt.after @@ -1,4 +1,4 @@ val foo: String - get() { + get() { return "abc" } diff --git a/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after b/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after index 4f97f4d3f4c..87ee8eadae6 100644 --- a/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after +++ b/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after @@ -1,6 +1,6 @@ // WITH_RUNTIME val foo: String - get() { + get() { throw UnsupportedOperationException() } diff --git a/idea/testData/intentions/convertToBlockBody/setter.kt.after b/idea/testData/intentions/convertToBlockBody/setter.kt.after index 5e343c1de61..6814b2f7aee 100644 --- a/idea/testData/intentions/convertToBlockBody/setter.kt.after +++ b/idea/testData/intentions/convertToBlockBody/setter.kt.after @@ -1,6 +1,6 @@ var foo: String get() = "abc" - set(value) { + set(value) { doSet(value) } diff --git a/idea/testData/quickfix/createFromUsage/createVariable/localVariable/afterInAccessorWithExpressionBody.kt b/idea/testData/quickfix/createFromUsage/createVariable/localVariable/afterInAccessorWithExpressionBody.kt index 4e169f7b1f9..83779ca800d 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/localVariable/afterInAccessorWithExpressionBody.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/localVariable/afterInAccessorWithExpressionBody.kt @@ -3,7 +3,7 @@ // ERROR: Variable 'foo' must be initialized class A { - val t: Int get() { + val t: Int get() { val foo: Int return foo }