# Is there a way to cast a Intention to QuickFix?

**URL:** <https://platform.jetbrains.com/t/is-there-a-way-to-cast-a-intention-to-quickfix/5043>\
**Category:** IntelliJ Platform\
**Tags:** plugin-development\
**Created:** [September 11, 2026, 4:35am UTC](https://platform.jetbrains.com/t/is-there-a-way-to-cast-a-intention-to-quickfix/5043 "2026-09-11T04:35:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taskeren](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/taskeren/32/3363_2.png) [@Taskeren](https://platform.jetbrains.com/u/Taskeren)\
**Post date:** [September 11, 2026, 4:35am UTC](https://platform.jetbrains.com/t/is-there-a-way-to-cast-a-intention-to-quickfix/5043/1 "2026-09-11T04:35:02Z")

</div>

I’m new to developing plugins.

I’m developing a plugin to ignore **RedundantTypeArguments** when the called method is marked by a certain annotation, and ask for a explicit generic type marked.

There’s a **[InsertExplicitTypeArgumentsIntention](https://github.com/JetBrains/intellij-community/blob/11e2ee95912142c5d931fc91280ab2e57060502f/plugins/kotlin/code-insight/intentions-k2/src/org/jetbrains/kotlin/idea/codeinsight/intentions/InsertExplicitTypeArgumentsIntention.kt#L15)** from kotlin plugin, and I want to reuse the logic. Inside, it calls [addTypeArguments](https://github.com/JetBrains/intellij-community/blob/11e2ee95912142c5d931fc91280ab2e57060502f/plugins/kotlin/code-insight/utils/src/org/jetbrains/kotlin/idea/codeinsight/utils/InsertExplicitTypeArgumentsUtils.kt#L51) but I don’t know what the context is.

Motivation JetBrains/java-annotations#139

---

<div class="post-metadata">

**Author:** ![yuriy.artamonov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yuriy.artamonov/32/48_2.png) [@yuriy.artamonov](https://platform.jetbrains.com/u/yuriy.artamonov)\
**Post date:** [September 11, 2026, 9:11am UTC](https://platform.jetbrains.com/t/is-there-a-way-to-cast-a-intention-to-quickfix/5043/2 "2026-09-11T09:11:34Z")

</div>

Hi, unfortunately intentions are not meant to be called programmatically, they are UI elements.

In order to reuse any code from them, their logic should be extracted to a function/service.

---

<div class="post-metadata">

**Author:** ![illuminatedcloud](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/illuminatedcloud/32/55_2.png) [@illuminatedcloud](https://platform.jetbrains.com/u/illuminatedcloud)\
**Post date:** [September 11, 2026, 4:54pm UTC](https://platform.jetbrains.com/t/is-there-a-way-to-cast-a-intention-to-quickfix/5043/3 "2026-09-11T16:54:18Z")

</div>

You could extend `com.intellij.codeInspection.IntentionAndQuickFixAction` to provide a single implementation that serves both roles, or you use could use `com.intellij.codeInspection.ex.QuickFixWrapper` to wrap a `LocalQuickFix` as an `IntentionAction`. Of course, those are both just specific ways to do what Yuriy recommends, each taking advantage of a existing features of the plugin SDK.
