KT-7291 Copy/paste of java declaration with preceding comment omitted does not convert it to Kotlin propertly

#KT-7291 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-04-09 15:21:56 +03:00
parent bfadd489a3
commit 498f24b98b
18 changed files with 304 additions and 21 deletions
@@ -367,16 +367,16 @@ public fun JetExpression.isFunctionLiteralOutsideParentheses(): Boolean {
}
}
public fun PsiElement.siblings(forward: Boolean = true, withItself: Boolean = true): Stream<PsiElement> {
public fun PsiElement.siblings(forward: Boolean = true, withItself: Boolean = true): Sequence<PsiElement> {
val stepFun = if (forward) { e: PsiElement -> e.getNextSibling() } else { e: PsiElement -> e.getPrevSibling() }
val stream = stream(this, stepFun)
return if (withItself) stream else stream.drop(1)
val sequence = sequence(this, stepFun)
return if (withItself) sequence else sequence.drop(1)
}
public fun ASTNode.siblings(forward: Boolean = true, withItself: Boolean = true): Stream<ASTNode> {
public fun ASTNode.siblings(forward: Boolean = true, withItself: Boolean = true): Sequence<ASTNode> {
val stepFun = if (forward) { node: ASTNode -> node.getTreeNext() } else { e: ASTNode -> e.getTreeNext() }
val stream = stream(this, stepFun)
return if (withItself) stream else stream.drop(1)
val sequence = sequence(this, stepFun)
return if (withItself) sequence else sequence.drop(1)
}
public fun PsiElement.parents(withItself: Boolean = true): Sequence<PsiElement> {
@@ -384,9 +384,9 @@ public fun PsiElement.parents(withItself: Boolean = true): Sequence<PsiElement>
return if (withItself) sequence else sequence.drop(1)
}
public fun ASTNode.parents(withItself: Boolean = true): Stream<ASTNode> {
val stream = stream(this) { it.getTreeParent() }
return if (withItself) stream else stream.drop(1)
public fun ASTNode.parents(withItself: Boolean = true): Sequence<ASTNode> {
val sequence = sequence(this) { it.getTreeParent() }
return if (withItself) sequence else sequence.drop(1)
}
public fun JetExpression.getAssignmentByLHS(): JetBinaryExpression? {