mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
move suppress/settings intention down (IDEA-72320 )
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
void method() {
|
||||
final String i = "";
|
||||
i = "<caret>";
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.intellij.codeInsight.intention.EmptyIntentionAction;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.ProblemsHolder;
|
||||
import com.intellij.codeInspection.defUse.DefUseInspection;
|
||||
import com.intellij.psi.JavaElementVisitor;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.PsiLiteralExpression;
|
||||
@@ -26,7 +27,7 @@ public class EmptyIntentionInspectionQuickFixTest extends LightQuickFixTestCase{
|
||||
|
||||
@Override
|
||||
protected LocalInspectionTool[] configureLocalInspectionTools() {
|
||||
return new LocalInspectionTool[]{new LocalInspectionTool() {
|
||||
return new LocalInspectionTool[]{new DefUseInspection(), new LocalInspectionTool() {
|
||||
@Override
|
||||
@Nls
|
||||
@NotNull
|
||||
@@ -74,4 +75,26 @@ public class EmptyIntentionInspectionQuickFixTest extends LightQuickFixTestCase{
|
||||
}
|
||||
assertEquals(1, emptyActions.size());
|
||||
}
|
||||
|
||||
public void testLowPriority() throws Exception {
|
||||
configureByFile(getBasePath() + "/LowPriority.java");
|
||||
List<IntentionAction> emptyActions = getAvailableActions();
|
||||
int i = 0;
|
||||
for(;i < emptyActions.size(); i++) {
|
||||
final IntentionAction intentionAction = emptyActions.get(i);
|
||||
if ("Make 'i' not final".equals(intentionAction.getText())) {
|
||||
break;
|
||||
}
|
||||
if (intentionAction instanceof EmptyIntentionAction) {
|
||||
fail("Low priority action prior to quick fix");
|
||||
}
|
||||
}
|
||||
assertTrue(i < emptyActions.size());
|
||||
for (; i < emptyActions.size(); i++) {
|
||||
if (emptyActions.get(i) instanceof EmptyIntentionAction) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
fail("Missed inspection setting action");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
* User: anna
|
||||
* Date: May 11, 2005
|
||||
*/
|
||||
public final class EmptyIntentionAction implements IntentionAction{
|
||||
public final class EmptyIntentionAction implements IntentionAction, LowPriorityAction{
|
||||
private final String myName;
|
||||
|
||||
public EmptyIntentionAction(@NotNull String name) {
|
||||
|
||||
Reference in New Issue
Block a user