rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Create a new project from another template? #448

Closed enolive closed 5 years ago

enolive commented 5 years ago

It seems that the plugin runs stack new with a hard-wired template (I guess simple)

So my question is if there is a chance to override the template somehow as I would do on the CLI by entering 'stack new $TEMPLATE-URL`.

Use case: I created my own opionated haskell mustache file mainly focused on doing TDD. It would be great to create an own project directly from the IDE.

rikvdkleij commented 5 years ago

The most simple solution is to create an extra Haskell Setting which contains name of template and it's by default new-template

enolive commented 5 years ago

How do I do that?

You don't mean a default-template setting in the $HOME/.stack/config.yaml, do you? Because that won't work.

default-template: https://raw.githubusercontent.com/enolive/haskell-templates/master/tdd.hsfiles
rikvdkleij commented 5 years ago

The most simple solution is to create an extra Haskell Setting which contains name of template and it's by default new-template

Sorry, I mean that this solution has to be implemented in plugin. The name of the template will be passed to stack new command.

enolive commented 5 years ago

Wow, great stuff! As far as I can tell, the feature works perfectly (I had a little trouble first with stack new but it was to some sort of incompatibility with the new lts-14 build plan easily solvable by stack upgrade)

There is an unrelated IDE fatal error with the logger, though. I will report it separately.

Thanks again for your effort!