-
Notifications
You must be signed in to change notification settings - Fork 175
Command line flag for project root directory? #913
Comments
Can you explain the use case for this a bit more? Just a flag that chdirs somewhere hardly seems worthwhile, just use Now support for forcing a specific project type (what the code calls 'cradle') to be used would be a more reasonable request and probably easy to add. However I would prefer not to add more features to ghc-mod's command line interface than absolutely necessary. It's already a horrible mess and it won't get better by adding more stuff. The library interface, used by haskell-ide-engine for example, could surely use a way to specify exactly what kind of project is desired though. |
@DanielG: The
or (quelle horreur!!!):
The use case for this is the SublimeHaskell plugin, where I've encountered at least one instance when a newbie has created a cabal sandbox, build and installed OTOH, I do wonder if |
I still don't see a reason why |
As for h-i-e you'll want to ask @alanz. |
In HIE, when the client (i.e. IDE) starts up the server, it sends through a project root directory. HIE then does a ghc-mod API call to change to that directory, and then operates. It is up to the client to identify and start up the appropriate HIE executable, as they are specific to the GHC version. And HIE is not on stackage yet, waiting for ghc-mod. Nudge @DanielG |
@DanielG: I'll give your solution a try... I'm not particularly keen on using the shell to start anything due to the interesting security holes that it can create. It's also not cross-platform: a lot of Also, @alanz: I'm speculating that |
I don't think security is a valid arguments against using this particular shell script but indeed I though windows support might be a concern. While I'm not happy about adding more stuff you can give it a shot if you want. @alanz remind me why we had to expose the commandline parser again? Every time I look at that code I get have a really, really bad feeling about it :/ |
Because hie parses the ghc-mod options, and passes them though. So rather use one parser, than have to keep two in sync. |
Would it be reasonably easy to add a command line flag that directs
ghc-mod
to initiallychdir
into a (presumably project root) directory? This would makeghc-mod
play better withcabal exec
andstack exec
and reduces global utility install pollution.Or has this been proposed before but ultimately rejected? (I didn't see anything related, on a quick scan through the issues.)
The text was updated successfully, but these errors were encountered: