List<IntentionAction> (@NotNull HighlightDisplayKey key, @NotNull ProblemDescriptor descriptor, @NotNull Set<? super Pair<TextRange, String>> emptyActionRegistered) { List<IntentionAction> result = new SmartList<>(); boolean needEmptyAction = true; QuickFix<?>[] fixes = descriptor.getFixes(); if (fixes != null && fixes.length != 0) { for (int k = 0; k < fixes.length; k++) { QuickFix<?> fix = fixes[k]; if (fix == null) { throw new IllegalStateException("Inspection " + key + " returns null quick fix in its descriptor: " + descriptor + "; array: " + Arrays.toString(fixes)); } result.add(QuickFixWrapper.wrap(descriptor, k)); needEmptyAction = false; } } HintAction hintAction = descriptor instanceof ProblemDescriptorImpl impl ? impl.getHintAction() : null; if (hintAction != null) { result.add(hintAction); needEmptyAction = false; } if (((ProblemDescriptorBase)descriptor).getEnforcedTextAttributes() != null) { needEmptyAction = false; } if (needEmptyAction && emptyActionRegistered.add(Pair.create(((ProblemDescriptorBase)descriptor).getTextRange(), key.toString()))) { String displayNameByKey = HighlightDisplayKey.getDisplayNameByKey(key); LOG.assertTrue(displayNameByKey != null, key.toString()); result.add(Registry.is("llm.empty.intention.generation") ? new EmptyIntentionGeneratorIntention(displayNameByKey, descriptor.getDescriptionTemplate()) : new EmptyIntentionAction(displayNameByKey)); } return result; }