Open i-walker opened 4 years ago
We need a table that looks like this for all plugins and involve several people to fill this in.
Plugin | Action | Icon | Description | Expanded Description |
---|---|---|---|---|
Purity | Inspection | [pic here] | This function is impure... | This function is impure..., Docs to IO, suspend, Fx etc |
Plugin | Feature | Icon | Description | Expanded Description |
---|---|---|---|---|
Comprehensions | LineMarker | arrow-meta-bind.svg |
"Bind" | - |
Nothing | LineMarker | arrow-meta-nothing.svg |
"Bottom Type" | - |
HigherKinds | LineMarker | arrow-meta-higher.svg |
${class.name} is a Higher Kinded Type that may be used in polymorphic functions expressed over [Kind<F, A>] and with the type classes. For more info visit https://arrow-kt.io/docs/patterns/glossary/#type-constructors | - |
HigherKinds | LineMarker | arrow-meta-polymorphic.svg |
here is an example | - |
Purity | Inspection | "Function should be suspended" | - | |
Optics | LineMarker | arrow-meta-optics.svg | "Optics" | - |
One proposal is to add a costume QuickDocumentProvider
, where we can display the text. I'll link a small PR down below, on how it may look like.
This may clash with the existing KotlinQuickDocumentProvider
, that does the same job you see down below for Kotlin. We would need to suppress it for special KtElements, but I haven't find API's who do that.
If we solely care about the Text we would add it as a KDoc on the descriptor and facilitate the existing Kotlin implementation. Bare with me I am adding more suggestions as I discover them.
Another way to present Text using Side Panels like the one we see with Kotlin Bytcode
This is feature is a composition of AnAction
and a ToolWindow.
Here Kotlin Bytecode
is triggered through the Tools Panel and opens a Toolwindow on the left side.
it allows us to focus on the Content and how it is displayed rather than to create separate UI elements on top of Idea.
The advantage here is that we can move this Action
to different places, e.g.: wrap it into a LineMarker
and whenever a user clicks on it, it triggers the action. Toolwindows can be persistent as we see with Gradle
.
Example impl for Show Kotlin Bytecode
is here
addAnAction(
"ExampleEmptyToolWindow",
anAction(
icon = ArrowIcons.PURE,
actionPerformed = {e ->
/**
* creates Toolwindow with [e]
* set's the icon
* ContentManager adds our Content
* This Content can be composed of [EditorTextField], which is IntelliJ's promoted editor component with syntax highlighting support, code completion, code folding and more.
*/
}
)
)
Both approaches are things we can use for different purposes. What about embedded media like gifs or videos. Is that possible or does that require some other kind of panel?
Gifs should be possible, but I can not confidently confirm whether videos are possible. There might be a workaround to do that.
Can we have the above linked icons rendered on the markdown table to see what they look like?
The editor defines it's UI with an initial wrapper, which holds it's Content.
We can use 4 existing UI wrappers/ templates from the editor:
Tool Windows proposed here https://github.com/arrow-kt/arrow-meta/issues/131#issuecomment-557104807
Dialogs they provide visuals to then trigger AnAction
with the supplied information of the user. They can look as simple as this (UserInput) -> AnAction
:
PopUps: They're similar to Dialogs, but without explicit closing buttons and reduce to a Function (UserInput) -> AnAction
example from above
Notifications: Can be invoked everywhere and display text, with an Icon.
addAnAction(
"ExampleNotification",
anAction(
icon = ArrowIcons.BIND,
actionPerformed = { e ->
Notifications.Bus.notify(
Notification("GroupDisplayId", "Arrow", "COntentLepsum",
NotificationType.WARNING)) // this Notificitation can hold an Icon
}
)
)
Or start from scratch with our own workflows. This requires us to maintain the lifecycle of the wrapper in the application in addition to the Content.
The initial four elements wrap our Content in templates, where we can focus on the Content.
Regardless of a design choice, the UI is based on Swing Components wether for the Content or the wrapper. Interestingly enough, we could facilitate the existing wrapper, but still, have the freedom to define our own workflows in the Content element.
I see on the table we are missing unions and type classes extensions. Also type proofs which even if not merged yet will be there by KC
This PR provides drafts over the aforementioned UI wrappers https://github.com/arrow-kt/arrow-meta/pull/214
As the Test's for the existing LM is about to be merged in #129, we may discuss what Text or GoTo actions we want to implement for
Meta
, wether Users click on the Icon, which then directs them on their default browser to Doc's and tutorials or display the Text.Interestingly enough, LineMarkers have in most cases short messages. If we do want to present more such as we do in the PolyLineMarker or much more, I'll work on API's which opens up TextDisplays on the right-hand side with Content we want to communicate, similar to the Toolbar on the right-hand side for Gradle or the Markdown ide plugin. The same API could also be used for the
AnkIdePlugin
to render the Docs. cc @raulraja @franciscodr @nomisRev