@@ -9,6 +9,8 @@ import * as util from './util';
9
9
var config : conf . Config = conf . getConfig ( ) ;
10
10
// map of saved terminals of current session
11
11
var terminal : Map < string , vscode . Terminal > = new Map ( ) ;
12
+ // stack run button already initialized
13
+ var stackRunBtn : boolean = false ;
12
14
13
15
// I'm not sure if we can do `async` here
14
16
export async function activate ( context : vscode . ExtensionContext ) {
@@ -19,11 +21,13 @@ export async function activate(context: vscode.ExtensionContext) {
19
21
// update config
20
22
vscode . workspace . onDidChangeConfiguration ( e => {
21
23
config = conf . getConfig ( ) ;
22
- if ( config . showRun ) {
24
+ if ( config . showRun && ! stackRunBtn ) {
23
25
switch ( project ) {
24
26
case 'stack' :
27
+ stackRunBtn = true ;
25
28
return util . resgisterStatButton ( context , "Stack Run" , "runner2.hsrun" ) ;
26
29
case 'cabal' :
30
+ stackRunBtn = true ;
27
31
return util . resgisterStatButton ( context , "Cabal Run" , "runner2.hsrun" ) ;
28
32
default : return ;
29
33
}
@@ -40,7 +44,6 @@ export async function activate(context: vscode.ExtensionContext) {
40
44
// currently at GHCi
41
45
const term = util . getTermOption ( terminal , "GHCi" )
42
46
. map ( term => ( ) => {
43
- console . log ( term . exitStatus , term . state ) ;
44
47
if ( inproject ) {
45
48
term . sendText ( ":r" ) ; // reload modules in project
46
49
} else {
@@ -95,6 +98,7 @@ export async function activate(context: vscode.ExtensionContext) {
95
98
util . resgisterStatButton ( context , project + " Build" , "runner2.hsbuild" ) ;
96
99
util . resgisterStatButton ( context , project + " Test" , "runner2.hstest" ) ;
97
100
if ( config . showRun ) {
101
+ stackRunBtn = true ;
98
102
util . resgisterStatButton ( context , project + " Run" , "runner2.hsrun" ) ;
99
103
}
100
104
} ;
0 commit comments