Skip to content
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

Merged
merged 19 commits into from
Jan 1, 2020
Merged

Dialogs, PopUps and Notifications #214

merged 19 commits into from
Jan 1, 2020

Conversation

i-walker
Copy link
Member

@i-walker i-walker commented Nov 22, 2019

Exampletory PR for UI wrappers, related to #131.

  • Dialog
    Screenshot 2019-11-22 at 16 49 00
    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 existing FileTemplates.
  • PopUp
  • Notification

@i-walker i-walker mentioned this pull request Nov 22, 2019
@raulraja
Copy link
Member

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 New ADT style feature which gives you the entire structure and you just type names and tab over arguments. Nothing for now just some thoughts for the future of this api. Kudos

@i-walker i-walker marked this pull request as ready for review December 11, 2019 19:23
# Conflicts:
#	idea-plugin/src/main/kotlin/arrow/meta/ide/dsl/IdeSyntax.kt
@i-walker
Copy link
Member Author

@raulraja this is ready for review. I will add Docs to Notifications once I know more about them.

* )
* }
* ```
* @param actionId has to be unique
Copy link
Collaborator

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?

Copy link
Member Author

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.


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
Copy link
Collaborator

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) 
                      } 
               } 
         }

Copy link
Member Author

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) }
Copy link
Collaborator

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

@i-walker i-walker merged commit d961400 into master Jan 1, 2020
@i-walker i-walker deleted the is-dialogs branch January 1, 2020 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants