idea-plugin / arrow.meta.ide.dsl.editor.intention / IntentionSyntax / ktIntention

ktIntention

open fun <K : KtElement> IntentionSyntax.ktIntention(text: String = "", kClass: Class<K> = KtElement::class.java as Class<K>, isApplicableTo: (element: K, caretOffset: Int) -> Boolean = Noop.boolean2False, applyTo: KtPsiFactory.(element: K, editor: Editor) -> Unit = Noop.effect3, priority: Priority = PriorityAction.Priority.LOW): SelfTargetingIntention<K>

ktIntention constructs SelfTargetingIntention. SelfTargetingIntentions can be used with Annotator.

Parameters

applyTo - allows to resolve the errors on this element with KtPsiFactory, display refined errors through the editor and has many other use-cases. For instance Java utilizes PsiElementFactory

text - is the displayed text in the ide. In addition, text needs to be the same as familyName in order to create MetaData for an Intention.

isApplicableTo - defines when this intention is available.

priority - defines the position of this Intention - PriorityAction.Priority.TOP being the highest.open fun IntentionSyntax.ktIntention(action: (diagnostic: Diagnostic) -> IntentionAction? = Noop.nullable1(), isApplicableForCodeFragment: Boolean = false, actionsForAll: (diagnostics: List<Diagnostic>) -> List<IntentionAction> = Noop.emptyList1()): KotlinSingleIntentionActionFactory

The default values are derived from KotlinIntentionActionsFactory.

Parameters

actionsForAll - provide for all errors a list of generalized Fixes

See Also

KotlinSingleIntentionActionFactory

QuickFixActionBase

Do you like Arrow?

Arrow Org
<