FormattingModelBuilder (@NotNull Language language, @NotNull PsiElement context) { for (FormattingModelBuilder builder : allForLanguage(language)) { if (builder instanceof CustomFormattingModelBuilder custom) { if (custom.isEngagedToFormat(context)) return builder; } } return null; }