Skip to content
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

Merged
merged 2 commits into from Jul 2, 2019
Merged

Improved code of PsiContainer #935

merged 2 commits into from Jul 2, 2019

Conversation

@ice1000
Copy link
Contributor

@ice1000 ice1000 commented Jun 18, 2019

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

element = element.nextSibling
}
}
fun elements() = generateSequence(start) { it.nextSibling?.takeIf { it != end } }
Copy link
Contributor Author

@ice1000 ice1000 Jun 18, 2019

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

Loading

override fun accept(visitor: PsiElementVisitor) = iterateElements {
start.accept(visitor)
}
override fun accept(visitor: PsiElementVisitor) = elements().forEach { it.accept(visitor) }
Copy link
Contributor Author

@ice1000 ice1000 Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Bug fix".

Loading

Copy link
Member

@HannahSchellekens HannahSchellekens left a comment

Agree on everything. Let's say you'll learn a lot in a few years ;)

Loading

@HannahSchellekens HannahSchellekens changed the title Kotlin programming Improved code of PsiContainer Jun 18, 2019
@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Jun 19, 2019

Any updates?

Loading

@PHPirates
Copy link
Collaborator

@PHPirates PHPirates commented Jun 30, 2019

Please resolve merge conflicts.

Loading

@ice1000
Copy link
Contributor Author

@ice1000 ice1000 commented Jul 1, 2019

Please resolve merge conflicts.

Done.

Loading

@HannahSchellekens HannahSchellekens merged commit efa98db into Hannah-Sten:master Jul 2, 2019
1 check passed
Loading
@ice1000 ice1000 deleted the kt branch Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants