boolean (@NotNull ASTNode node) { AtomicBoolean result = new AtomicBoolean(false); ((TreeElement)node).acceptTree(new RecursiveTreeElementWalkingVisitor() { @Override protected void visitNode(TreeElement element) { if (element instanceof OuterLanguageElement) { result.set(true); stopWalking(); return; } super.visitNode(element); } }); return result.get(); }