mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
Don't warn about missing tag description on void methods
GitOrigin-RevId: 7125c41e5adfb4a45f96b6f5c9b6db12a9a0da6d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ea5b5de628
commit
1a75f19cff
@@ -326,7 +326,7 @@ public class JavaDocLocalInspection extends LocalInspectionTool {
|
||||
}
|
||||
|
||||
if (!myIgnoreEmptyDescriptions) {
|
||||
JavadocHighlightUtil.checkEmptyMethodTagsDescription(tags, holder);
|
||||
JavadocHighlightUtil.checkEmptyMethodTagsDescription(tags, method, holder);
|
||||
}
|
||||
|
||||
checkBasics(docComment, tags, method, false, METHOD_OPTIONS, holder);
|
||||
|
||||
@@ -438,14 +438,16 @@ public final class JavadocHighlightUtil {
|
||||
}
|
||||
}
|
||||
|
||||
static void checkEmptyMethodTagsDescription(PsiDocTag @NotNull [] tags, @NotNull ProblemHolder holder) {
|
||||
static void checkEmptyMethodTagsDescription(PsiDocTag @NotNull [] tags,
|
||||
@NotNull PsiMethod psiMethod,
|
||||
@NotNull ProblemHolder holder) {
|
||||
for (PsiDocTag tag : tags) {
|
||||
if (ContainerUtil
|
||||
.exists(tag.getChildren(), e -> e instanceof PsiInlineDocTag && ((PsiInlineDocTag)e).getName().equals("inheritDoc"))) {
|
||||
continue;
|
||||
}
|
||||
if ("return".equals(tag.getName())) {
|
||||
if (emptyTag(tag)) {
|
||||
if (!PsiType.VOID.equals(psiMethod.getReturnType()) && emptyTag(tag)) {
|
||||
String tagText = "<code>@return</code>";
|
||||
LocalQuickFix fix = holder.removeTagWithoutDescriptionFix("return");
|
||||
holder.problem(tag.getNameElement(), JavaBundle.message("inspection.javadoc.method.problem.missing.tag.description", tagText), fix);
|
||||
|
||||
Reference in New Issue
Block a user