class Test {
var n: Int = 0 /*C1*/ ; protected set
}
var n: Int = 0 /*C1*/ ; protected set is a K.Property.
protected set is a setter accessor in the K.Property, it can be in a new line and then no semi-colon is required, but it can be in the same line and then a semi-colon is required as a delimiter.
For the latter case with a semi-colon inside a K.Property, However, there is not a space room for /*C1*/ in K.Property.
This PR proposed to change variable declarations in K.Property from type J.VariableDeclarations to JRightPadded<J.VariableDeclarations>, plus SemiColon marker, then this case can be handled.
fixes https://github.com/openrewrite/rewrite-kotlin/issues/560
An code example:
var n: Int = 0 /*C1*/ ; protected set
is aK.Property
.protected set
is a setter accessor in theK.Property
, it can be in a new line and then no semi-colon is required, but it can be in the same line and then a semi-colon is required as a delimiter. For the latter case with a semi-colon inside aK.Property
, However, there is not a space room for/*C1*/
inK.Property
.This PR proposed to change variable declarations in
K.Property
from typeJ.VariableDeclarations
toJRightPadded<J.VariableDeclarations>
, plusSemiColon
marker, then this case can be handled.