Opening this issue to notify interested users and authors of editor bindings to stack-ide. This update requires you to update both stack and stack-mode. stack-ide the binary itself has no changes, but you can update anyway if you like.
The way loading is done with stack-ide has changed now. Initially, it would work like this:
- stack-ide is launched by stack, and stack sends the list of load targets (modules) to load.
- stack-ide would then load these modules and report errors.
- Your editor would send
RequestUpdateSession with empty contents.
Now, it's like this:
stack ide is launched by the editor via stack ide start <package-target> (that can be acquired by stack ide packages).
- Your editor should call
stack ide load-targets <package-target> to get a list of modules that are in the project.
- Your editor then sends
RequestUpdateSession when it wants to load module(s):
{
"tag": "RequestUpdateSession",
"contents": [
{
"tag": "RequestUpdateTargets",
"contents": {
"tag": "TargetsExclude",
"contents": [
"src/Control/Concurrent/Execute.hs",
"src/Stack/Package.hs"
]
}
},
{
"tag": "RequestUpdateTargets",
"contents": {
"tag": "TargetsInclude",
"contents": [
"src/Stack/Package.hs"
]
}
}
]
}
This request will load everything necessary for Stack.Package and no more. The two target updates are monoidal, so the latter overrides the former (this is why you can specify Package.hs in both, a small convenience). This is much faster than the previous approach of loading everything every time. When you do want to load everything, you can put the complete list of modules in TargetsInclude and omit TargetsExclude entirely.
Reference implementation in Emacs here: https://github.com/commercialhaskell/stack-ide/blob/master/stack-mode/stack-mode.el#L892-L911
In stack-mode this keybinding is now:
- C-c C-l - load the current module.
- C-c C-c - compile all modules.
This can be seen as analogous to :l in GHCi vs cabal build. The flycheck behaviour uses the C-c C-l case -- it only compiles the current module. When you want to check all modules, C-c C-c will trigger flycheck for all modules.
Pinging @lukexi (stack-ide-sublime author).
Pinging @snoyberg @mgsloan @lukehoersten @dysinger @CRogers.
Opening this issue to notify interested users and authors of editor bindings to stack-ide. This update requires you to update both
stackandstack-mode.stack-idethe binary itself has no changes, but you can update anyway if you like.The way loading is done with stack-ide has changed now. Initially, it would work like this:
RequestUpdateSessionwith empty contents.Now, it's like this:
stack ideis launched by the editor viastack ide start <package-target>(that can be acquired bystack ide packages).stack ide load-targets <package-target>to get a list of modules that are in the project.RequestUpdateSessionwhen it wants to load module(s):{ "tag": "RequestUpdateSession", "contents": [ { "tag": "RequestUpdateTargets", "contents": { "tag": "TargetsExclude", "contents": [ "src/Control/Concurrent/Execute.hs", "src/Stack/Package.hs" ] } }, { "tag": "RequestUpdateTargets", "contents": { "tag": "TargetsInclude", "contents": [ "src/Stack/Package.hs" ] } } ] }This request will load everything necessary for
Stack.Packageand no more. The two target updates are monoidal, so the latter overrides the former (this is why you can specify Package.hs in both, a small convenience). This is much faster than the previous approach of loading everything every time. When you do want to load everything, you can put the complete list of modules inTargetsIncludeand omitTargetsExcludeentirely.Reference implementation in Emacs here: https://github.com/commercialhaskell/stack-ide/blob/master/stack-mode/stack-mode.el#L892-L911
In
stack-modethis keybinding is now:This can be seen as analogous to
:lin GHCi vscabal build. The flycheck behaviour uses theC-c C-lcase -- it only compiles the current module. When you want to check all modules,C-c C-cwill trigger flycheck for all modules.Pinging @lukexi (stack-ide-sublime author).
Pinging @snoyberg @mgsloan @lukehoersten @dysinger @CRogers.