@@ -17,6 +17,7 @@ import {
17
17
import { searchById } from '../helper' ;
18
18
import { editor as MonacoEditor , Uri } from 'mo/monaco' ;
19
19
import { IMenuItemProps } from 'mo/components' ;
20
+ import { ExplorerService , IExplorerService } from './explorer/explorerService' ;
20
21
21
22
export interface IEditorService extends Component < IEditor > {
22
23
/**
@@ -196,10 +197,12 @@ export class EditorService
196
197
implements IEditorService {
197
198
protected state : IEditor ;
198
199
protected defaultActions : IEditorActionsProps [ ] ;
200
+ protected explorerService : IExplorerService ;
199
201
constructor ( ) {
200
202
super ( ) ;
201
203
this . state = container . resolve ( EditorModel ) ;
202
204
this . defaultActions = getEditorInitialActions ( ) ;
205
+ this . explorerService = container . resolve ( ExplorerService ) ;
203
206
}
204
207
205
208
public updateEditorOptions ( options : IEditorOptions ) : void {
@@ -378,6 +381,7 @@ export class EditorService
378
381
( ) => {
379
382
const isOpened = this . isOpened ( tabId ) ;
380
383
! isOpened && this . disposeModel ( tab ) ;
384
+ this . explorerService . forceUpdate ( ) ;
381
385
}
382
386
) ;
383
387
}
@@ -411,6 +415,7 @@ export class EditorService
411
415
this . setActive ( groupId , tabId ! ) ;
412
416
413
417
this . disposeModel ( removedTabs ) ;
418
+ this . explorerService . forceUpdate ( ) ;
414
419
}
415
420
416
421
public closeToRight ( tab : IEditorTab , groupId : number ) {
@@ -442,6 +447,7 @@ export class EditorService
442
447
} ) ;
443
448
this . setActive ( groupId , tabId ! ) ;
444
449
this . disposeModel ( removedTabs || [ ] ) ;
450
+ this . explorerService . forceUpdate ( ) ;
445
451
}
446
452
447
453
public closeToLeft ( tab : IEditorTab , groupId : number ) {
@@ -473,6 +479,7 @@ export class EditorService
473
479
} ) ;
474
480
this . setActive ( groupId , tabId ! ) ;
475
481
this . disposeModel ( removedTabs || [ ] ) ;
482
+ this . explorerService . forceUpdate ( ) ;
476
483
}
477
484
478
485
public getGroupById ( groupId : number ) : IEditorGroup | undefined {
@@ -591,6 +598,7 @@ export class EditorService
591
598
current : group ,
592
599
groups : [ ...groups ] ,
593
600
} ) ;
601
+ this . explorerService . forceUpdate ( ) ;
594
602
}
595
603
596
604
public onOpenTab ( callback : ( tab : IEditorTab ) => void ) : void {
@@ -626,6 +634,7 @@ export class EditorService
626
634
( ) => {
627
635
// dispose all models in specific group
628
636
this . disposeModel ( removed ) ;
637
+ this . explorerService . forceUpdate ( ) ;
629
638
}
630
639
) ;
631
640
}
0 commit comments