ghciwatch icon indicating copy to clipboard operation
ghciwatch copied to clipboard

[DUX-1292] Multi-project Stack support

Open 9999years opened this issue 1 year ago • 0 comments

With a multi-project Stack workspace, Stack will ask the following question instead of starting up ghci immediately. This breaks the prompt-matching automation.

* * * * * * * *
The main module to load is ambiguous. Candidates are:
1. Package `app' component exe:app-example with main-is file: /Users/rvion/dev/cogito/app/Main.hs
2. Package `pghs' component exe:pg2hs with main-is file: /Users/rvion/dev/cogito/pghs/Main.hs
You can specify which one to pick by:
 * Specifying targets to stack ghci e.g. stack ghci app:exe:app-example
Specify main module to use (press enter to load none): Not loading any main modules, as no valid     module selected
 * Specifying what the main is e.g. stack ghci --main-is app:exe:app-example

 * Choosing from the candidate above [1..2]
* * * * * * * *

https://github.com/ndmitchell/ghcid/issues/57

Implementation outline:

  1. The IncrementalReader will need to be modified to return which pattern it found to delimit a chunk of lines.
  2. GhciStdout::initialize will need to be modified to look for the above prompt as well as the ghci version announcements.

From SyncLinear.com | DUX-1292

9999years avatar Aug 10 '23 17:08 9999years