idea-plugin / arrow.meta.ide.dsl.extensions / ExtensionProviderSyntax / registerExtensionPoint

registerExtensionPoint

open fun <E> MetaIde.registerExtensionPoint(EP_NAME: BaseExtensionPointName<E>, aClass: Class<E>, kind: Kind): ExtensionPhase

Registers BaseExtensionPointName’s

See Also

registerExtensionPoint

open fun <E> MetaIde.registerExtensionPoint(EP_NAME: ExtensionPointName<E>, aClass: Class<E>, kind: Kind): ExtensionPhase

Interestingly enough, ExtensionProvider registers new workflows to the ide. Given an example Provider:

import com.intellij.openapi.extensions.ExtensionPointName
import javax.swing.Icon

//sampleStart
interface MetaProvider {
  fun <A> List<Icon>.helloMeta(f: (Icon) -> A): List<A>
  companion object {
    val EP_NAME: ExtensionPointName<MetaProvider> =
      ExtensionPointName("arrow.meta.ide.dsl.extensions.MetaProvider") // The EP_NAME is the FQ name of your Provider
  }
}
//sampleEnd

Registering MetaProvider in Meta may look like this:

import arrow.meta.ide.IdePlugin
import arrow.meta.ide.MetaIde
import arrow.meta.ide.dsl.editor.lineMarker.LineMarkerSyntax
import arrow.meta.ide.invoke
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.extensions.ExtensionPoint
import javax.swing.Icon

interface MetaProvider {
  fun <A> List<Icon>.helloMeta(f: (Icon) -> A): List<A>
  companion object {
    val EP_NAME: ExtensionPointName<MetaProvider> =
      ExtensionPointName("arrow.meta.ide.dsl.extensions.MetaProvider") // The EP_NAME is the FQ name of your Provider
  }
}
//sampleStart
val MetaIde.registeringIdeExtensions: IdePlugin
  get() = "Register ExtensionPoints" {
    meta(
       registerExtensionPoint(MetaProvider.EP_NAME, MetaProvider::class.java, ExtensionPoint.Kind.INTERFACE)
    )
  }
//sampleEnd

Parameters

kind - There are more resources on the ExtensionPointKinds here

Do you like Arrow?

Arrow Org
<