@@ -78,7 +78,7 @@ export const activate = async () => {
78
78
79
79
// Main activation actions
80
80
81
- let reloadExtHostExtensions = false
81
+ let patchedManifestExtensions = [ ] as string [ ]
82
82
for ( const [ id , expected ] of Object . entries ( getExtensionSetting ( 'overrideActivationEvents' ) ) ) {
83
83
const ext = vscode . extensions . getExtension ( id )
84
84
if ( ! ext ) continue
@@ -96,19 +96,25 @@ export const activate = async () => {
96
96
4 ,
97
97
) ,
98
98
)
99
- reloadExtHostExtensions = true
99
+ patchedManifestExtensions . push ( id )
100
100
}
101
101
}
102
- if ( reloadExtHostExtensions ) {
103
- vscode . window . showInformationMessage ( 'Restarting extension host as activation events were patched...' )
104
- await vscode . commands . executeCommand ( 'workbench.action.restartExtensionHost' )
105
- return
102
+ if ( patchedManifestExtensions . length ) {
103
+ const action = await vscode . window . showInformationMessage (
104
+ `Manifest of these extension were patched: ${ patchedManifestExtensions } ` ,
105
+ 'Reload window to apply' ,
106
+ )
107
+ if ( action ) {
108
+ await vscode . commands . executeCommand ( 'workbench.action.reloadWindow' )
109
+ return
110
+ }
106
111
}
107
112
108
113
const extVersion = extensionCtx . extension . packageJSON . version
109
114
const currentLoadedConfig = process . env . VSC_CONTROL_EXT_CONFIG && JSON . parse ( process . env . VSC_CONTROL_EXT_CONFIG )
110
115
const patchedVersion = currentLoadedConfig ?. version
111
- if ( patchedVersion && patchedVersion === extVersion ) {
116
+ if ( patchedVersion && ( patchedVersion === extVersion || process . env . NODE_ENV === 'development' ) ) {
117
+ // dev: force patch here when needed
112
118
if ( process . env . VSC_CONTROL_EXT_CONFIG !== JSON . stringify ( getNewConfig ( ) ) ) await updateConfig ( )
113
119
} else {
114
120
if (
0 commit comments