void () { if (mySubBlocks == null) { GroovyBlockGenerator generator = new GroovyBlockGenerator(this); List<ASTNode> children = GroovyBlockGenerator.getClosureBodyVisibleChildren(myNode.getTreeParent()); mySubBlocks = generator.generateCodeSubBlocks(children); //at least -> exists assert !mySubBlocks.isEmpty(); TextRange firstRange = mySubBlocks.get(0).getTextRange(); TextRange lastRange = mySubBlocks.get(mySubBlocks.size() - 1).getTextRange(); myTextRange = new TextRange(firstRange.getStartOffset(), lastRange.getEndOffset()); } }