Skip to content

Commit

Permalink
Respond to PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <rob@oxbeef.net>
  • Loading branch information
robstryker committed Feb 1, 2024
1 parent 76f337b commit ea354ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.BodyDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.Javadoc;
import org.eclipse.jdt.core.dom.ModuleDeclaration;
import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving;
import org.eclipse.jdt.internal.corext.dom.ASTNodes;
import org.eclipse.jdt.internal.ui.text.correction.AddAllMissingJavadocTagsProposalCore;
import org.eclipse.jdt.internal.ui.text.correction.AddJavadocCommentProposalCore;
import org.eclipse.jdt.internal.ui.text.correction.AddMissingJavadocTagProposalCore;
Expand Down Expand Up @@ -68,6 +72,18 @@ public ASTNode getCoveringNode(CompilationUnit astRoot) {
}
}

@Override
public void addMissingJavadocTagProposals(IInvocationContextCore context, ASTNode node, Collection<ProposalKindWrapper> proposals) {
ASTNode node2 = ASTNodes.getNormalizedNode(node);
BodyDeclaration bodyDeclaration = ASTResolving.findParentBodyDeclaration(node2);
if (bodyDeclaration != null) {
Javadoc javadoc = bodyDeclaration.getJavadoc();
if (javadoc != null) {
super.addMissingJavadocTagProposals(context, node, proposals);
}
}
}

public static void getRemoveJavadocTagProposals(IInvocationContextCore context, IProblemLocationCore problem,
Collection<ProposalKindWrapper> proposals) {
new JavadocTagsSubProcessor().addRemoveJavadocTagProposals(context, problem, proposals);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,7 @@ public static boolean getTryWithResourceProposals(IProblemLocationCore[] locatio
}

public static boolean problemExists(IProblemLocationCore[] locations, List<Integer> problems) {
for (IProblemLocationCore location : locations) {
if (problems.contains(location.getProblemId())) {
return true;
}
}
return false;
return findProblemLocation(locations, problems) != null;
}

public static IProblemLocationCore findProblemLocation(IProblemLocationCore[] locations, List<Integer> problems) {
Expand Down

0 comments on commit ea354ef

Please sign in to comment.