use of com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper in project intellij-community by JetBrains.
the class IntentionListStep method getWeight.
private int getWeight(IntentionActionWithTextCaching action) {
IntentionAction a = action.getAction();
int group = getGroup(action);
if (a instanceof IntentionActionWrapper) {
a = ((IntentionActionWrapper) a).getDelegate();
}
if (a instanceof IntentionWrapper) {
a = ((IntentionWrapper) a).getAction();
}
if (a instanceof HighPriorityAction) {
return group + 3;
}
if (a instanceof LowPriorityAction) {
return group - 3;
}
if (a instanceof SuppressIntentionActionFromFix) {
if (((SuppressIntentionActionFromFix) a).isShouldBeAppliedToInjectionHost() == ThreeState.NO) {
return group - 1;
}
}
if (a instanceof QuickFixWrapper) {
final LocalQuickFix quickFix = ((QuickFixWrapper) a).getFix();
if (quickFix instanceof HighPriorityAction) {
return group + 3;
}
if (quickFix instanceof LowPriorityAction) {
return group - 3;
}
}
return group;
}
use of com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper in project intellij-community by JetBrains.
the class IPPTestCase method assertIntentionNotAvailable.
protected void assertIntentionNotAvailable(Class<? extends IntentionAction> intentionClass) {
myFixture.configureByFile(getTestName(false) + ".java");
final List<IntentionAction> result = new SmartList<>();
for (final IntentionAction intention : myFixture.getAvailableIntentions()) {
if (intentionClass.isInstance(intention)) {
result.add(intention);
} else if (intention instanceof IntentionActionWrapper) {
final IntentionActionWrapper wrapper = (IntentionActionWrapper) intention;
if (intentionClass.isInstance(wrapper.getDelegate())) {
result.add(intention);
}
}
}
assertEmpty("Intention of class \'" + intentionClass + "\' is available but should not", result);
}
Aggregations