@@ -3,6 +3,28 @@ import * as conf from '../utils/configuration';
33
44const bar = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
55
6+ const emu = [
7+ conf . DosEmulatorType . jsdos ,
8+ conf . DosEmulatorType . dosbox ,
9+ conf . DosEmulatorType . dosboxX ,
10+ conf . DosEmulatorType . msdos
11+ ] ;
12+
13+ const asm = [
14+ conf . Assembler . MASM ,
15+ conf . Assembler . TASM
16+ ] ;
17+
18+ const iterms : string [ ] = [ ] ;
19+ for ( const e of emu ) {
20+ for ( const a of asm ) {
21+ if ( a === conf . Assembler . TASM && e === conf . DosEmulatorType . msdos ) {
22+ continue ;
23+ }
24+ iterms . push ( e + '\t' + a ) ;
25+ }
26+ }
27+
628function showStatus ( ) {
729 bar . command = 'masmtasm.updateEmuASM' ;
830 bar . text = `${ conf . extConf . emulator } ${ conf . extConf . asmType } ` ;
@@ -11,32 +33,16 @@ function showStatus() {
1133
1234async function statusBarCommand ( ) {
1335 const _conf = vscode . workspace . getConfiguration ( 'masmtasm.ASM' ) ;
14- const emu = [
15- conf . DosEmulatorType . jsdos ,
16- conf . DosEmulatorType . dosbox ,
17- conf . DosEmulatorType . dosboxX
18- ] ;
36+
1937 if ( process . platform === 'win32' ) {
2038 emu . push ( conf . DosEmulatorType . msdos ) ;
2139 }
2240
23- const asm = [
24- conf . Assembler . MASM ,
25- conf . Assembler . TASM
26- ] ;
27-
28- const iterms = [ ] ;
29- for ( const e of emu ) {
30- for ( const a of asm ) {
31- iterms . push ( e + ' ' + a ) ;
32- }
33- }
34-
3541 const placeHolder = 'choose DOS environment emulator and assembler' ;
3642 const Selected = await vscode . window . showQuickPick ( iterms , { placeHolder } ) ;
3743 if ( Selected ) {
38- const [ emu1 , asm1 ] = Selected ?. split ( ' ' ) ;
39- const target = vscode . ConfigurationTarget . Workspace ;
44+ const [ emu1 , asm1 ] = Selected ?. split ( '\t ' ) ;
45+ const target = vscode . ConfigurationTarget . Global ;
4046 await _conf . update ( 'emulator' , emu1 , target ) ;
4147 await _conf . update ( 'assembler' , asm1 , target ) ;
4248 showStatus ( ) ;
0 commit comments