New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved code of PsiContainer #935
Conversation
element = element.nextSibling | ||
} | ||
} | ||
fun elements() = generateSequence(start) { it.nextSibling?.takeIf { it != end } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will generate a lazy sequence, end when it.nextSibling
is null or it == end
override fun accept(visitor: PsiElementVisitor) = iterateElements { | ||
start.accept(visitor) | ||
} | ||
override fun accept(visitor: PsiElementVisitor) = elements().forEach { it.accept(visitor) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Bug fix".
Agree on everything. Let's say you'll learn a lot in a few years ;)
Any updates? |
Please resolve merge conflicts. |
Done. |
This is how we write codes in Kotlin.
Additions
N/A, but possibly a bug-fix, will comment soon to explain
Changes
N/A
Backwards incompatible changes
N/A