TextRange (@NotNull final ASTNode element, @NotNull final TextRange range) { PsiElement e = SourceTreeToPsiMap.treeElementToPsi(element); assert e != null && e.isValid(); final PsiFile file = e.getContainingFile(); final Project project = e.getProject(); if (!CodeStyle.getCustomSettings(file, JavaCodeStyleSettings.class).ENABLE_JAVADOC_FORMATTING || element.getPsi().getContainingFile().getLanguage() != JavaLanguage.INSTANCE || InjectedLanguageManager.getInstance(project).isInjectedFragment(element.getPsi().getContainingFile())) { return range; } return formatCommentsInner(project, element, range); }