Skip to content

Commit e623ac7

Browse files
committed
more updates
1 parent 476ef1a commit e623ac7

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ All notable changes to the *Haskell Runner 2* will be documented in this file.
66

77
- nil
88

9-
## [0.4.0]
9+
## [0.4.0] (not yet released)
1010

1111
- avoid reusing recovered terminal at startup by keeping track of active terminals created by Haskell Runner 2
12+
- `Stack Run` button can now be hot loaded, but disabling still requires reload
1213
- remove activate on `Cabal` language
1314

1415
## [0.3.0]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following configurations are available:
2222
- `runner2.stackPath`: path for stack executable (default `stack`)
2323
- `runner2.cabalPath`: path for cabal executable (default `cabal`)
2424
- `runner2.replTool`: by `default`, it use `ghci` in single file and use `stack repl` (or `cabal repl`) in stack project. This can be overridden by choosing other options (`ghci` for ghci only, and `stack` (or `cabal`) for stack/cabal repl only)
25-
- `runner2.showRunButton`: show "Stack/Cabal Run" button, *reload required* (default `false`)
25+
- `runner2.showRunButton`: show "Stack/Cabal Run" button (default `false`)
2626

2727
## Release Notes
2828

src/extension.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,23 @@ var terminal: Map<string, vscode.Terminal> = new Map();
1212

1313
// I'm not sure if we can do `async` here
1414
export async function activate(context: vscode.ExtensionContext) {
15-
// update config
16-
vscode.workspace.onDidChangeConfiguration(e => { config = conf.getConfig(); });
1715
// check stack/cabal project
1816
const hasConf = async (f: string) => (await vscode.workspace.findFiles(f)).length > 0;
1917
let project: conf.ProjectTy = (await hasConf("stack.yaml")) ? "stack" : (await hasConf("*.cabal") ? "cabal" : "none");
2018
let inproject = project !== "none";
19+
// update config
20+
vscode.workspace.onDidChangeConfiguration(e => {
21+
config = conf.getConfig();
22+
if (config.showRun) {
23+
switch (project) {
24+
case 'stack':
25+
return util.resgisterStatButton(context, "Stack Run", "runner2.hsrun");
26+
case 'cabal':
27+
return util.resgisterStatButton(context, "Cabal Run", "runner2.hsrun");
28+
default: return;
29+
}
30+
}
31+
});
2132

2233
// GHCi command
2334
const ghci = vscode.commands.registerCommand("runner2.ghci", () => {

0 commit comments

Comments
 (0)