mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IRV: IDEA-80843 removal entries removes more than you expect
This commit is contained in:
+19
@@ -187,6 +187,14 @@ public abstract class DescriptorProviderInspection extends InspectionTool implem
|
||||
getIgnoredElements().put(refEntity, problemDescriptors);
|
||||
}
|
||||
|
||||
public void ignoreCurrentElementProblem(RefEntity refEntity, CommonProblemDescriptor descriptor) {
|
||||
CommonProblemDescriptor[] descriptors = getIgnoredElements().get(refEntity);
|
||||
if (descriptors == null) {
|
||||
descriptors = new CommonProblemDescriptor[0];
|
||||
}
|
||||
getIgnoredElements().put(refEntity, ArrayUtil.append(descriptors, descriptor));
|
||||
}
|
||||
|
||||
private static boolean isIgnoreProblem(QuickFix[] problemFixes, Set<QuickFix> fixes, int idx){
|
||||
if (problemFixes == null || fixes == null) {
|
||||
return true;
|
||||
@@ -451,6 +459,17 @@ public abstract class DescriptorProviderInspection extends InspectionTool implem
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isProblemResolved(RefEntity refEntity, CommonProblemDescriptor descriptor) {
|
||||
if (getIgnoredElements() == null) return false;
|
||||
for (RefEntity entity : getIgnoredElements().keySet()) {
|
||||
if (Comparing.equal(entity, refEntity)) {
|
||||
final CommonProblemDescriptor[] descriptors = getIgnoredElements().get(refEntity);
|
||||
return ArrayUtil.contains(descriptor, descriptors);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public FileStatus getProblemStatus(final CommonProblemDescriptor descriptor) {
|
||||
final GlobalInspectionContextImpl context = getContext();
|
||||
if (context != null && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN){
|
||||
|
||||
@@ -95,11 +95,11 @@ public class ProblemDescriptionNode extends InspectionTreeNode {
|
||||
|
||||
|
||||
public boolean isResolved() {
|
||||
return myElement instanceof RefElement && myTool.isElementIgnored(myElement);
|
||||
return myElement instanceof RefElement && myTool.isProblemResolved(myElement, getDescriptor());
|
||||
}
|
||||
|
||||
public void ignoreElement() {
|
||||
myTool.ignoreCurrentElement(getElement());
|
||||
myTool.ignoreCurrentElementProblem(getElement(), getDescriptor());
|
||||
}
|
||||
|
||||
public void amnesty() {
|
||||
|
||||
Reference in New Issue
Block a user