- TODO Make on-configuration-change restart more specific
- TODO Alert users for configuration migration
ghcSimple.useObjectCode
is gone.ghcSimple.workspaceType
is gone.
- Configuration options?
- Preferably minimal, delegate most to
hie.yaml
or.ghcid
- Let the user override the detection mechanism?
- Preferably minimal, delegate most to
startupCommands
- Implicit sharing
- Documents each get their own configuration
- Two documents can share one GHCi instance
- If the configurations are sharable (flag), and the
key
field is the same
- If the configurations are sharable (flag), and the
- The
key
is a JSON serializable field emitted along with the configuration- Informaation like 'This is a
stack
project on/path/to/root
with componentfoo
'
- Informaation like 'This is a
TextDocument
→Session
: SameSession
for. Suitable for calling one-off commands.Configuration
→Session
: More flexible, sharing still possible- Specify a 'generic' key → Shared across all extensions
- Specify an extension-specific key (maybe
extensionId
in key) → Shared within one extension only - ... Other use cases?
- Can also specify non-sharable session
- Probably also access to configuration detection algorithm.
- Each configuration can specify a set of glob patterns
- If any of these fiels are changed, the configuration's session is killed
- Dependency of shared sessions is the union of
Legends:
(TODO)
: I know how this works, but I didn't write the code yet(???)
: I still need to figure out how this works
For each file, considered separately:
- If file has no workspace
- If
stack
runnable,file-stack
- Else,
file
- If
- Else, If workspace has custom command
- If
replScope
isworkspace
,custom-workspace
- Else:
custom-file
- If
- Else, if
hie.yaml
in workspace root:- This is a
hie-bios-cradle
workspace - Find Cradle match in
hie.yaml
(TODO)
- Find GHCi command like
hie-bios
(???)
- Find deps like
hie-bios
(???)
- This is a
- Else, if
.ghcid
in workspace root- This is a
ghcid
workspace - Start GHCi using specified commands
(TODO)
- Deps as specified
(TODO)
- This is a
- Else, if
stack.yaml
in workspace root:stack query
to get targets(TODO)
stack repl $target
(TODO)
- Deps
(???)
- Else, if
*.cabal
orcabal.project
orcabal.project.local
in workspace root:cabal v2-repl all
(TODO)
- Deps
(???)
cradle:
cabal: # Or stack
- path: "./src"
component: "lib:hie-bios" # cabal v2-repl lib:hie-bios
- path: "./test"
component: "test:bios-tests" # cabal v2-repl test:bios-tests
cabal:
component: "lib:hie-bios" # cabal v2-repl lib:hie-bios
stack:
component: "hie-bios:lib" # stack repl hie-bios:lib
bios:
program: "program to run"
dependency-program: "optional program to run"
direct:
arguments: ["list","of","ghc","arguments"]
none: # Maybe just fail. Cache the result
multi: - path: ./
config: { cradle: ... }
dependencies:
- someDep
(From GHC)
--command sh ./hadrian/ghci
--reload compiler
--reload ghc
--reload includes
--restart hadrian/
This command is unquoted???
How does ghcid
really parse these?