Spacing (@NotNull Block parentBlock, @Nullable IElementType parentType, @Nullable IElementType child1Type, @Nullable IElementType child2Type) { for (SpacingRule rule : myRules) { if (rule.matches(parentType, child1Type, child2Type)) { return rule.createSpacing(parentBlock.getTextRange()); } } return null; }