-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dialogs, PopUps and Notifications #214
Conversation
This will come handy to initialize patterns like ADTs etc in file templates when you create a new model, algebra, interpreters etc as we can include stubs and instructions to get the user going. I'm thinking in |
# Conflicts: # idea-plugin/src/main/kotlin/arrow/meta/ide/dsl/IdeSyntax.kt
This reverts commit 9359c97
# Conflicts: # idea-plugin/src/main/kotlin/arrow/meta/ide/dsl/IdeSyntax.kt
# Conflicts: # idea-plugin/src/main/kotlin/arrow/meta/ide/dsl/IdeSyntax.kt
@raulraja this is ready for review. I will add Docs to Notifications once I know more about them. |
* ) | ||
* } | ||
* ``` | ||
* @param actionId has to be unique |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been very good about this part and plan on coming back later on in the quote-and-template system, but should we only describe tricky params or all of them eventually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on which of them are important to know. For example with actionId
. the ide crashes if there are more than 2 Actions with the same Id. Those actionIds
are used by theAnActionManager
, which orchestrates all existing Actions and their lifecycle.
idea-plugin/src/main/kotlin/arrow/meta/ide/dsl/ui/dialogs/DialogSyntax.kt
Show resolved
Hide resolved
idea-plugin/src/main/kotlin/arrow/meta/ide/dsl/ui/dialogs/DialogSyntax.kt
Show resolved
Hide resolved
|
||
override fun postProcess(createdElement: PsiFile?, templateName: String?, customProperties: MutableMap<String, String>?): Unit = | ||
createdElement?.let { el -> templateName?.let { name -> customProperties?.let { prop -> postProcess(el, name, prop) } } } | ||
?: Unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to return a Unit
? I know we like to keep it pure and avoid Unit if possible but I was wondering about the motivation to do so over something this like this since we're just looking to make a call here:
override fun postProcess(createdElement: PsiFile?, templateName: String?, customProperties: MutableMap<String, String>?) =
createdElement?.let { el ->
templateName?.let { name ->
customProperties?.let { prop ->
postProcess(el, name, prop)
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your function has a different return Type than the one this features needs.
this@run.firstOrNull { it == selectedValue }?.hasSubStep ?: false | ||
|
||
override fun onChosen(selectedValue: A, finalChoice: Boolean): PopupStep<*> = | ||
this@run.firstOrNull { it == selectedValue }?.let { a -> a.onChosen(selectedValue, finalChoice) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a
meant to also be a: A
? perhaps this can be made a little clearer, like selectedValueType
Exampletory PR for UI wrappers, related to #131.
I will fix the issue by adding new internal FileTemplates in another PR. For now, this creates a
Kotlin File
and is extendable to all existingFileTemplates
.