use of com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider in project intellij-community by JetBrains.
the class HighlightUtil method getChangeVariableTypeFixes.
@NotNull
public static List<IntentionAction> getChangeVariableTypeFixes(@NotNull PsiVariable parameter, PsiType itemType) {
if (itemType instanceof PsiMethodReferenceType)
return Collections.emptyList();
List<IntentionAction> result = new ArrayList<>();
if (itemType != null) {
for (ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME)) {
Collections.addAll(result, fixProvider.getFixes(parameter, itemType));
}
}
IntentionAction changeFix = getChangeParameterClassFix(parameter.getType(), itemType);
if (changeFix != null)
result.add(changeFix);
return result;
}
use of com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider in project intellij-community by JetBrains.
the class UncheckedWarningLocalInspectionBase method getChangeVariableTypeFixes.
@NotNull
private static LocalQuickFix[] getChangeVariableTypeFixes(@NotNull PsiVariable parameter, @Nullable PsiType itemType, LocalQuickFix[] generifyFixes) {
if (itemType instanceof PsiMethodReferenceType)
return generifyFixes;
LOG.assertTrue(parameter.isValid());
final List<LocalQuickFix> result = new ArrayList<>();
if (itemType != null) {
for (ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME)) {
for (IntentionAction action : fixProvider.getFixes(parameter, itemType)) {
if (action instanceof LocalQuickFix) {
result.add((LocalQuickFix) action);
}
}
}
}
if (generifyFixes.length > 0) {
Collections.addAll(result, generifyFixes);
}
return result.toArray(new LocalQuickFix[result.size()]);
}
Aggregations