kharf
08/19/2021, 8:03 AMval anchor = owner
?.firstChild!!
.siblings(forward = true)
.dropWhile { it is PsiComment || it is PsiWhiteSpace }
What is the general convention, in case you don't chain? In my opinion it is more clear when you put the safe call operator in the same line as the object you apply the safe call to, like:
getSth?.let {
hho
08/19/2021, 8:56 AMTobias Berger
08/19/2021, 8:59 AMval anchor = owner
?.firstChild
...
rather than
val anchor = owner?.
firstChild
...
When you're not chaining/wrapping, you can just keep ?.xyz
in the same line. That's also how the examples in the Kotlin docs are formatted