idea-plugin / arrow.meta.ide.dsl.editor.lineMarker / LineMarkerSyntax

LineMarkerSyntax

interface LineMarkerSyntax

LineMarker’s serve as visuals, which appear on specified PsiElements. There are several methods to subscribe LineMarkers, the one LineMarkerSyntax provides is derived from Kotlin’s org.jetbrains.kotlin.idea.highlighter.KotlinSuspendCallLineMarkerProvider and org.jetbrains.kotlin.idea.highlighter.KotlinRecursiveCallLineMarkerProvider. In general, subscription techniques differ mainly in performance.

Functions

addLineMarkerProvider open fun <A : PsiElement> MetaIde.addLineMarkerProvider(transform: (PsiElement) -> A?, lineMarkerInfo: (a: A) -> LineMarkerInfo<*>?, slowLineMarker: (a: A) -> LineMarkerInfo<*>? = Noop.nullable1()): ExtensionPhase
Due tu performance reason’s it is advised that A is a leaf element (e.g: Psi(Identifier)) and not composite PsiElements such as KtClass. The identifying PsiElement of the latter is the class name. The PsiViewer Plugin may help to verify that A is a leaf element, by observing the tree structure of the PsiElement. Nonetheless, IntelliJ will automatically send warnings during the runIde gradle task, if an implementation doesn’t comply with this premise.open fun <A : PsiElement> MetaIde.addLineMarkerProvider(icon: Icon, transform: (PsiElement) -> A?, message: (element: A) -> String = Noop.string1(), placed: Alignment = GutterIconRenderer.Alignment.RIGHT, navigate: (event: MouseEvent, element: PsiElement) -> Unit = Noop.effect2, clickAction: AnAction? = null): ExtensionPhase
addLineMarkerProvider is a convenience extension, which registers the Leaf element of a composite PsiElement A e.g.: KtClass and circumvents effort’s to find the right PsiElement. In addition, plugin developer’s can compose sophisticated messages, as the whole scope of A can be exploited.open fun <A : PsiNameIdentifierOwner> MetaIde.addLineMarkerProvider(icon: Icon, transform: (PsiElement) -> A?, composite: Class<A>, message: DescriptorRenderer.Companion.(A) -> String = Noop.string2(), placed: Alignment = GutterIconRenderer.Alignment.RIGHT, navigate: (event: MouseEvent, element: PsiElement) -> Unit = Noop.effect2, clickAction: AnAction? = null): ExtensionPhase
addLineMarkerProviderM Similar to addLineMarkerProvider, but with mergeable LineMarkers, based on the predicate mergeWith.open fun <A : PsiElement> MetaIde.addLineMarkerProviderM(icon: Icon, transform: (PsiElement) -> A?, message: (element: A) -> String = Noop.string1(), commonIcon: MergeableLineMarkerInfo<PsiElement>.(others: List<MergeableLineMarkerInfo<*>>) -> Icon = { icon }, mergeWith: MergeableLineMarkerInfo<PsiElement>.(other: MergeableLineMarkerInfo<*>) -> Boolean = { this.icon == it.icon }, placed: Alignment = GutterIconRenderer.Alignment.RIGHT, navigate: (event: MouseEvent, element: PsiElement) -> Unit = Noop.effect2, clickAction: AnAction? = null): ExtensionPhase
open fun <A : PsiNameIdentifierOwner> MetaIde.addLineMarkerProviderM(icon: Icon, transform: (PsiElement) -> A?, composite: Class<A>, message: DescriptorRenderer.Companion.(A) -> String = Noop.string2(), commonIcon: MergeableLineMarkerInfo<PsiElement>.(others: List<MergeableLineMarkerInfo<*>>) -> Icon = { icon }, mergeWith: MergeableLineMarkerInfo<PsiElement>.(other: MergeableLineMarkerInfo<*>) -> Boolean = { this.icon == it.icon }, navigate: (event: MouseEvent, element: PsiElement) -> Unit = Noop.effect2, placed: Alignment = GutterIconRenderer.Alignment.RIGHT, clickAction: AnAction? = null): ExtensionPhase
addRelatedLineMarkerProvider open fun <A : PsiElement, B : PsiElement> MetaIde.addRelatedLineMarkerProvider(icon: Icon, transform: (PsiElement) -> A?, targets: (A) -> List<B>, message: DescriptorRenderer.Companion.(A, targets: List<B>) -> String? = Noop.nullable3(), cellRenderer: PsiElementListCellRenderer<B> = DefaultListCellRenderer.default(), popUpTitle: DescriptorRenderer.Companion.(A, targets: List<B>) -> String? = Noop.string3(), placed: Alignment = GutterIconRenderer.Alignment.RIGHT): ExtensionPhase
Algebra notes // com.intellij.psi.SmartPointerManager as the receiver #createSmartPsiElementPointer {open fun <A : PsiNameIdentifierOwner, B : PsiElement> MetaIde.addRelatedLineMarkerProvider(icon: Icon, transform: (PsiElement) -> A?, composite: Class<A>, targets: (A) -> List<B>, message: DescriptorRenderer.Companion.(A, targets: List<B>) -> String? = Noop.nullable3(), cellRenderer: PsiElementListCellRenderer<B> = DefaultListCellRenderer.default(), popUpTitle: DescriptorRenderer.Companion.(A, targets: List<B>) -> String? = Noop.string3(), placed: Alignment = GutterIconRenderer.Alignment.RIGHT): ExtensionPhase
lineMarkerInfo open fun LineMarkerSyntax.lineMarkerInfo(icon: Icon, element: PsiElement, message: (PsiElement) -> String, placed: Alignment = GutterIconRenderer.Alignment.LEFT, navigate: (event: MouseEvent, element: PsiElement) -> Unit = Noop.effect2, clickAction: AnAction? = null): LineMarkerInfo<PsiElement>
mergeableLineMarkerInfo MergeableLineMarkerInfo can merge multiple LineMarkerInfo’s into one, if mergeWith is true.open fun LineMarkerSyntax.mergeableLineMarkerInfo(icon: Icon, element: PsiElement, message: (PsiElement) -> String, commonIcon: MergeableLineMarkerInfo<PsiElement>.(others: List<MergeableLineMarkerInfo<*>>) -> Icon = { icon }, mergeWith: MergeableLineMarkerInfo<PsiElement>.(other: MergeableLineMarkerInfo<*>) -> Boolean = { this.icon == it.icon }, placed: Alignment = GutterIconRenderer.Alignment.LEFT, navigate: (event: MouseEvent, element: PsiElement) -> Unit = Noop.effect2, clickAction: AnAction? = null): MergeableLineMarkerInfo<PsiElement>
navigateGutter open fun <A : PsiElement, B : PsiElement> LineMarkerSyntax.navigateGutter(icon: Icon, psi: A, targets: (A) -> List<B>, message: (A, targets: List<B>) -> String? = Noop.nullable2(), cellRenderer: PsiElementListCellRenderer<B> = DefaultListCellRenderer.default(), popUpTitle: (A, targets: List<B>) -> String? = Noop.string2(), placed: Alignment = GutterIconRenderer.Alignment.RIGHT): (PsiElement) -> RelatedItemLineMarkerInfo<PsiElement>
navigationGutter creates a NavigationGutteropen fun <A : PsiElement, R> LineMarkerSyntax.navigationGutter(icon: Icon, element: A, config: NavigationGutterIconBuilder<PsiElement>.(A) -> R): Ropen fun <A, R> LineMarkerSyntax.navigationGutter(icon: Icon, element: A, targets: (A) -> List<PsiElement>, config: NavigationGutterIconBuilder<A>.(A) -> R): R
onComposite provides a function f from a Leaf PsiElementopen fun <A : PsiElement, L : LineMarkerInfo<PsiElement>> PsiElement.onComposite(composite: Class<A>, f: (A) -> L): L?
registerLineMarker open fun MetaIde.registerLineMarker(provider: LineMarkerProvider): ExtensionPhase
relatedLineMarkerProvider registers a RelatedItemLineMarkerProvideropen fun <A : PsiElement> MetaIde.relatedLineMarkerProvider(transform: (PsiElement) -> A?, lineMarkerInfo: (a: A) -> RelatedItemLineMarkerInfo<PsiElement>?): ExtensionPhase

Inheritors

IdeSyntax interface IdeSyntax : IconProviderSyntax, SyntaxHighlighterSyntax, InspectionSyntax, AnActionSyntax, ColorSettingsSyntax, HintingSyntax, LanguageSyntax, LineMarkerSyntax, LiveTemplateSyntax, NavigationSyntax, SearchSyntax, StructureViewSyntax, UsageSyntax, ExtensionProviderSyntax, DocumentationSyntax, DialogSyntax, PopupSyntax, NotificationSyntax, ToolWindowSyntax, GotoRelatedSyntax, AnnotatorSyntax, ParserSyntax, ApplicationSyntax, FoldingSyntax, EditorSyntax, ResolveScopeSyntax, ResolveProviderSyntax, IntegrationSyntax

Do you like Arrow?

Arrow Org
<