@@ -12,6 +12,8 @@ import {
12
12
} from 'mo/services' ;
13
13
import { singleton , container } from 'tsyringe' ;
14
14
import { builtInPanelProblems , builtInStatusProblems } from 'mo/model/problems' ;
15
+ import { IMonacoService , MonacoService } from 'mo/monaco/monacoService' ;
16
+ import { QuickTogglePanelAction } from 'mo/monaco/quickTogglePanelAction' ;
15
17
export interface IProblemsController {
16
18
onClick ?: ( e : React . MouseEvent , item : IStatusBarItem ) => void ;
17
19
}
@@ -22,29 +24,29 @@ export class ProblemsController
22
24
private readonly panelService : IPanelService ;
23
25
private readonly statusBarService : IStatusBarService ;
24
26
private readonly layoutService : ILayoutService ;
27
+ private readonly monacoService : IMonacoService ;
25
28
26
29
constructor ( ) {
27
30
super ( ) ;
28
31
this . panelService = container . resolve ( PanelService ) ;
29
32
this . statusBarService = container . resolve ( StatusBarService ) ;
33
+ this . monacoService = container . resolve ( MonacoService ) ;
30
34
this . layoutService = container . resolve ( LayoutService ) ;
31
35
this . init ( ) ;
32
36
}
33
37
34
38
private showHideProblems ( ) {
39
+ const { panel } = this . layoutService . getState ( ) ;
40
+ if ( panel . hidden ) {
41
+ this . monacoService . commandService . executeCommand (
42
+ QuickTogglePanelAction . ID
43
+ ) ;
44
+ }
35
45
const { current } = this . panelService . getState ( ) ;
36
- const {
37
- panel : { hidden } ,
38
- } = this . layoutService . getState ( ) ;
39
- if ( hidden ) {
40
- this . layoutService . setPanelHidden ( ) ;
46
+ if ( current ?. id !== builtInPanelProblems ( ) . id ) {
41
47
this . panelService . open ( builtInPanelProblems ( ) ) ;
42
48
} else {
43
- if ( current ?. id !== builtInPanelProblems ( ) . id ) {
44
- this . panelService . open ( builtInPanelProblems ( ) ) ;
45
- } else {
46
- this . layoutService . setPanelHidden ( ) ;
47
- }
49
+ this . layoutService . setPanelHidden ( ) ;
48
50
}
49
51
}
50
52
0 commit comments