File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,6 @@ export class ExtensionServiceImpl extends WithEventBus implements ExtensionServi
364
364
if ( ! init ) {
365
365
// 重启场景下需要将申明过 browserView 的 sumi 插件的 contributes 重新跑一遍
366
366
await this . rerunSumiViewExtensionContributes ( ) ;
367
-
368
367
// 重启场景下把 ActivationEvent 再发一次
369
368
if ( this . activationEventService . activatedEventSet . size ) {
370
369
const activatedEventArr = Array . from ( this . activationEventService . activatedEventSet ) ;
@@ -630,9 +629,19 @@ export class ExtensionServiceImpl extends WithEventBus implements ExtensionServi
630
629
const extensionPaths = Array . from ( activatedViewExtensionMap . keys ( ) ) ;
631
630
632
631
await Promise . all (
633
- extensionPaths . map ( ( path ) => this . extensionInstanceManageService . getExtensionInstanceByPath ( path ) ?. initialize ( ) ) ,
632
+ extensionPaths . map ( ( path ) => {
633
+ const extension = this . extensionInstanceManageService . getExtensionInstanceByPath ( path ) ;
634
+ if ( extension ) {
635
+ extension . initialize ( ) ;
636
+ this . contributesService . register ( extension . id , extension . contributes ) ;
637
+ this . sumiContributesService . register ( extension . id , extension . packageJSON . kaitianContributes || { } ) ;
638
+ }
639
+ } ) ,
634
640
) ;
635
641
642
+ this . contributesService . initialize ( ) ;
643
+ this . sumiContributesService . initialize ( ) ;
644
+
636
645
activatedViewExtensionMap . clear ( ) ;
637
646
}
638
647
Original file line number Diff line number Diff line change @@ -256,6 +256,10 @@ export class ExtensionNodeServiceImpl implements IExtensionNodeService {
256
256
extServer . listen ( extServerListenOptions , ( ) => {
257
257
this . logger . log ( `${ clientId } ext server listen on ${ JSON . stringify ( extServerListenOptions ) } ` ) ;
258
258
} ) ;
259
+ // 重启时,旧的 path 已经不再使用,但是系统未清理,导致 listen 会失败,所以在连接关闭时,主动清理
260
+ extServer . on ( 'close' , ( ) => {
261
+ this . extServerListenOptions . delete ( clientId ) ;
262
+ } ) ;
259
263
}
260
264
261
265
private async _createExtHostProcess ( clientId : string , options ?: ICreateProcessOptions ) {
You can’t perform that action at this time.
0 commit comments