mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection toolwindow: do not track modification because fix doesn't mean modification + do not forget already ignored elements IDEA-156376
This commit is contained in:
@@ -24,8 +24,6 @@ import com.intellij.codeInspection.reference.RefManager;
|
||||
import com.intellij.codeInspection.ui.InspectionToolPresentation;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -92,7 +90,6 @@ public class LocalQuickFixWrapper extends QuickFixAction {
|
||||
@NotNull final GlobalInspectionContextImpl context,
|
||||
@NotNull final CommonProblemDescriptor[] descriptors,
|
||||
@NotNull final Set<PsiElement> ignoredElements) {
|
||||
final PsiModificationTracker tracker = PsiManager.getInstance(project).getModificationTracker();
|
||||
if (myFix instanceof BatchQuickFix) {
|
||||
final List<PsiElement> collectedElementsToIgnore = new ArrayList<>();
|
||||
final Runnable refreshViews = () -> {
|
||||
@@ -121,13 +118,10 @@ public class LocalQuickFixWrapper extends QuickFixAction {
|
||||
if (fixes != null) {
|
||||
final QuickFix fix = getWorkingQuickFix(fixes);
|
||||
if (fix != null) {
|
||||
final long startCount = tracker.getModificationCount();
|
||||
//CCE here means QuickFix was incorrectly inherited, is there a way to signal (plugin) it is wrong?
|
||||
fix.applyFix(project, descriptor);
|
||||
if (startCount != tracker.getModificationCount()) {
|
||||
restart = true;
|
||||
ignore(ignoredElements, descriptor, fix, context);
|
||||
}
|
||||
restart = true;
|
||||
ignore(ignoredElements, descriptor, fix, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -355,7 +355,8 @@ public class DefaultInspectionToolPresentation implements ProblemDescriptionsPro
|
||||
@Override
|
||||
public void ignoreCurrentElement(RefEntity refEntity) {
|
||||
if (refEntity == null) return;
|
||||
getIgnoredElements().put(refEntity, getProblemElements().get(refEntity));
|
||||
getIgnoredElements().put(refEntity, mergeDescriptors(getIgnoredElements().getOrDefault(refEntity, CommonProblemDescriptor.EMPTY_ARRAY),
|
||||
getProblemElements().getOrDefault(refEntity, CommonProblemDescriptor.EMPTY_ARRAY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user