void (@NotNull PsiJavaCodeReferenceElement ref, @NotNull QuickFixActionRegistrar registrar) { PsiFile containingFile = ref.getContainingFile(); if (containingFile instanceof PsiJavaCodeReferenceCodeFragment fragment && !fragment.isClassesAccepted()) { return; } List<IntentionAction> fixes = new ArrayList<>(); OrderEntryFix.registerFixes(ref, fixes); for (IntentionAction fix : fixes) { registrar.register(fix); } if (PsiUtil.isModuleFile(containingFile)) { registrar.register(new CreateServiceImplementationClassFix(ref)); registrar.register(new CreateServiceInterfaceOrClassFix(ref)); return; } registrar.register(new ImportClassFix(ref)); PsiElement refParent = ref.getParent(); if (!(refParent instanceof PsiMethodCallExpression)) { registrar.register(new StaticImportConstantFix(containingFile, ref)); registrar.register(new QualifyStaticConstantFix(containingFile, ref)); } MoveClassToModuleFix.registerFixes(registrar, ref); if (ref instanceof PsiReferenceExpression refExpr) { TextRange fixRange = HighlightMethodUtil.getFixRange(ref); registrar.register(fixRange, new RenameWrongRefFix(refExpr), null); PsiExpression qualifier = refExpr.getQualifierExpression(); if (qualifier != null) { AddTypeCastFix.registerFix(registrar, qualifier, ref, fixRange); } BringVariableIntoScopeFix bringToScope = BringVariableIntoScopeFix.fromReference(refExpr); if (bringToScope != null) { registrar.register(fixRange, bringToScope.asIntention(), null); } for (IntentionAction action : createVariableActions(refExpr)) { registrar.register(fixRange, action, null); } } for (IntentionAction action : createClassActions(ref)) { registrar.register(action); } SurroundWithQuotesAnnotationParameterValueFix.register(registrar, ref); if (PsiUtil.isLanguageLevel5OrHigher(ref)) { registrar.register(new CreateTypeParameterFromUsageFix(ref).asIntention()); } }