Formatter: Fix spacing between '=' and '{' in property accessors
This commit is contained in:
@@ -254,6 +254,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder {
|
|||||||
inPosition(parent = FINALLY, right = BLOCK).customRule(leftBraceRule())
|
inPosition(parent = FINALLY, right = BLOCK).customRule(leftBraceRule())
|
||||||
|
|
||||||
inPosition(parent = FUN, 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))
|
inPosition(right = CLASS_BODY).customRule(leftBraceRule(blockType = CLASS_BODY))
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,23 @@ public var Int.extVar1: Int = 122
|
|||||||
public
|
public
|
||||||
var
|
var
|
||||||
Int.extVar: Int = 1
|
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
|
annotation class A1
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,20 @@ var
|
|||||||
.
|
.
|
||||||
extVar : Int = 1
|
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 A1
|
||||||
annotation class A2
|
annotation class A2
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
val foo: String
|
val foo: String
|
||||||
get() {
|
get() {
|
||||||
return "abc"
|
return "abc"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
val foo: String
|
val foo: String
|
||||||
get() {
|
get() {
|
||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
var foo: String
|
var foo: String
|
||||||
get() = "abc"
|
get() = "abc"
|
||||||
set(value) {
|
set(value) {
|
||||||
doSet(value)
|
doSet(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
// ERROR: Variable 'foo' must be initialized
|
// ERROR: Variable 'foo' must be initialized
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
val t: Int get() {
|
val t: Int get() {
|
||||||
val foo: Int
|
val foo: Int
|
||||||
return foo
|
return foo
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user