mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
provide fix all intention for local inspections paired to global tools (IDEA-162507)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// "Fix all 'Member access can be tightened' problems in file" "true"
|
||||
class Test {
|
||||
private int myCounter;
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new Test().myCounter);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Fix all 'Member access can be tightened' problems in file" "true"
|
||||
class Test {
|
||||
<caret>public int myCounter;
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new Test().myCounter);
|
||||
}
|
||||
}
|
||||
+9
@@ -6,6 +6,9 @@ package com.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.dataFlow.DataFlowInspection;
|
||||
import com.intellij.codeInspection.ex.GlobalInspectionToolWrapper;
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.codeInspection.visibility.VisibilityInspection;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -18,6 +21,12 @@ public class FixAllQuickfixTest extends LightQuickFixParameterizedTestCase {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
enableInspectionTool(new GlobalInspectionToolWrapper(new VisibilityInspection()));
|
||||
}
|
||||
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -189,6 +189,11 @@ public class IntentionManagerImpl extends IntentionManager implements Disposable
|
||||
@Nullable
|
||||
@Override
|
||||
public IntentionAction createFixAllIntention(InspectionToolWrapper toolWrapper, IntentionAction action) {
|
||||
if (toolWrapper instanceof GlobalInspectionToolWrapper) {
|
||||
final LocalInspectionToolWrapper localWrapper = ((GlobalInspectionToolWrapper)toolWrapper).getSharedLocalInspectionToolWrapper();
|
||||
if (localWrapper != null) return createFixAllIntention(localWrapper, action);
|
||||
}
|
||||
|
||||
if (toolWrapper instanceof LocalInspectionToolWrapper) {
|
||||
Class aClass = action.getClass();
|
||||
if (action instanceof QuickFixWrapper) {
|
||||
|
||||
Reference in New Issue
Block a user