Skip to content

Commit

Permalink
update to 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Meowcolm024 committed Oct 14, 2022
1 parent 67062c4 commit 62956c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## [Unreleased]

## [0.1.3]

- fix typo
- use absolute path for GHCi
- add activation event (in a stack project)
Expand Down
10 changes: 3 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as vscode from 'vscode';
import * as option from './option';

export type Config = {
stackPath: string,
Expand All @@ -9,14 +8,11 @@ export type Config = {

export function getConfig(): Config {
const config = vscode.workspace.getConfiguration();
function getConfOption<T>(name: string, def: T): T {
return option.option<T>(config.get(name)).orelse(def);
}
let stack = getConfOption("runner2.stackPath", "stack");
let repl = getConfOption("runner2.stackRepl", false);
let stack = config.get("runner2.stackPath", "stack");
let repl = config.get("runner2.stackRepl", false);
return {
stackPath: stack,
ghciTool: repl ? (stack + " repl") : "ghci",
enableStackRun: getConfOption("runner2.stackRun", false)
enableStackRun: config.get("runner2.stackRun", false)
};
}
10 changes: 5 additions & 5 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export function resgisterStatButton(
name: string,
command: string,
align = vscode.StatusBarAlignment.Left,
priority = 10) {

priority = 10
) {
let stat = vscode.window.createStatusBarItem(align, priority);
stat.text = name;
stat.command = command;
Expand All @@ -18,9 +18,9 @@ export function resgisterStatButton(
// create a terminal and send command
export function registerSimplTerm(context: vscode.ExtensionContext, command: string, name: string, cmd: string) {
context.subscriptions.push(vscode.commands.registerCommand(command, () => {
let t = vscode.window.createTerminal(name);
t.sendText(cmd);
t.show();
let term = vscode.window.createTerminal(name);
term.sendText(cmd);
term.show();
}));
}

Expand Down

0 comments on commit 62956c4

Please sign in to comment.