Allow moving out to arbitrary blocks and moving any declaration into class body

This commit is contained in:
Alexey Sedunov
2013-05-30 17:29:53 +04:00
parent b00ec82884
commit 57edbdfbc4
15 changed files with 55 additions and 16 deletions
@@ -809,6 +809,12 @@ public class JetPsiUtil {
return first ? results.get(0) : results.get(results.size() - 1);
}
@Nullable
public static PsiElement findChildByType(@NotNull PsiElement element, @NotNull IElementType type) {
ASTNode node = element.getNode().findChildByType(type);
return node == null ? null : node.getPsi();
}
@Nullable
public static JetExpression getCalleeExpressionIfAny(@NotNull JetExpression expression) {
if (expression instanceof JetCallElement) {