PsiElement getChildren getFirstChild question
Hello,
i just came across the fact that getChildren() method of PsiElement returns only nodes which i built with PsiBuilder earlier, however getFirstChild() does not return first of those nodes, but i guess it returns PsiLeafElement (or what?) which wraps my tokens.
I wonder if this is the intended behaviour and why is it so and are there methods to get firstChild from getChildren() array, or getNextSibling() according to parent's getChildren() array?
请先登录再写评论。
Hello Jay,
This behavior is indeed confusing, but fixing it at this moment would break
compatibility with a lot of code, so I'm afraid this is going to stay.
You can just navigate the array returned by getChildren() yourself.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"