Formatter: Fix spacing between '=' and '{' in property accessors

This commit is contained in:
Alexey Sedunov
2014-12-22 19:38:43 +03:00
parent e76792d4f2
commit 05a0481efa
7 changed files with 35 additions and 4 deletions
@@ -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))
@@ -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
@@ -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
@@ -1,4 +1,4 @@
val foo: String
get() {
get() {
return "abc"
}
@@ -1,6 +1,6 @@
// WITH_RUNTIME
val foo: String
get() {
get() {
throw UnsupportedOperationException()
}
@@ -1,6 +1,6 @@
var foo: String
get() = "abc"
set(value) {
set(value) {
doSet(value)
}
@@ -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
}