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

Automatically fill prelude module name when prelude name is typed #255

Closed
vrom911 opened this issue Nov 27, 2018 · 5 comments · Fixed by #353
Closed

Automatically fill prelude module name when prelude name is typed #255

vrom911 opened this issue Nov 27, 2018 · 5 comments · Fixed by #353
Labels
Hacktoberfest https://hacktoberfest.digitalocean.com/ TUI

Comments

@vrom911
Copy link
Member

vrom911 commented Nov 27, 2018

Like in CLI, assume that if the prelude name is somePrelude the prelude module name could be SomePrelude.

@vrom911 vrom911 added the TUI label Nov 27, 2018
@Naman-sopho
Copy link

Hey, I would like to work on this feature.
From what I could gather the task at hand can be accomplished by adding to the validation logic here. We can fill the preludeModule field with an appropriate value if the preludeName field is populated.

@chshersh
Copy link
Contributor

@Naman-sopho isEmptyPrelude shows validation error in the Status box when name of the prelude package is not empty, but the module name is empty. I think that this check should remain as it is, because it is still very useful if this issue is implemented.

The proper way to solve this issue would be to handle all key events when filling prelude package edit input and fill name of the module on-the-fly.

@Naman-sopho
Copy link

Naman-sopho commented Mar 17, 2019

@chshersh
Sorry about the delay, the Brick documentation was a bit cryptic to understand.
I have completed an initial implementation which adds a CustomPreludeName pattern matching to an existing VtyEvent handler which dealt with checkbox activation. This triggers the autoFillPreludeModuleName function which reloads a new form with the module name filled. But I am not sure how to implement the getUpdatedForm i.e. how to extract the value from the Prelude field and insert it into the Module field thus creating the new form.

I have pushed the changes to my fork here.

@vrom911
Copy link
Member Author

vrom911 commented Apr 9, 2019

@Naman-sopho can you please make the PR if you think that we can help to proceed with the further work 🙂 It would be really nice to have these changes, however, the implementation might not be the easiest...

@juhp
Copy link

juhp commented Sep 8, 2019

I feel it would be nice to use/offer NoImplicitPrelude too: though it might also depend on the prelude.
(I know currently summoner uses base-noprelude so this is already "covered".)

Is it a sommoner-tui defect that the specified prelude module is not imported into Main.hs? (Next time I try the cli:)
edit: not sure, today with cli I added basic-prelude and it correctly setup BasicPrelude module, perhaps I was doing it wrong before in tui - need to check again..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest https://hacktoberfest.digitalocean.com/ TUI
Projects
None yet
4 participants