@@ -18,6 +18,8 @@ import * as vscode from 'vscode';
18
18
import { config } from './lib/config' ;
19
19
import { activate as activateWelcome } from './lib/welcome' ;
20
20
21
+ let needRestart = false ;
22
+
21
23
const incompatibleExtensionIds = [
22
24
'johnsoncodehk.vscode-typescript-vue-plugin' ,
23
25
'Vue.vscode-typescript-vue-plugin' ,
@@ -64,6 +66,27 @@ export const { activate, deactivate } = defineExtension(async () => {
64
66
65
67
nextTick ( ( ) => stop ( ) ) ;
66
68
69
+ if ( needRestart ) {
70
+ if ( vscode . env . remoteName ) {
71
+ vscode . window . showInformationMessage (
72
+ 'Please restart the extension host to activate Vue support in remote environments.' ,
73
+ 'Restart Extension Host' ,
74
+ 'Reload Window' ,
75
+ ) . then ( action => {
76
+ if ( action === 'Restart Extension Host' ) {
77
+ vscode . commands . executeCommand ( 'workbench.action.restartExtensionHost' ) ;
78
+ }
79
+ else if ( action === 'Reload Window' ) {
80
+ vscode . commands . executeCommand ( 'workbench.action.reloadWindow' ) ;
81
+ }
82
+ } ) ;
83
+ }
84
+ else {
85
+ vscode . commands . executeCommand ( 'workbench.action.restartExtensionHost' ) ;
86
+ }
87
+ return ;
88
+ }
89
+
67
90
watch ( ( ) => config . server . includeLanguages , async ( ) => {
68
91
const reload = await vscode . window . showInformationMessage (
69
92
'Please restart extension host to apply the new language settings.' ,
@@ -219,7 +242,7 @@ try {
219
242
}
220
243
221
244
if ( tsExtension . isActive ) {
222
- vscode . commands . executeCommand ( 'workbench.action.restartExtensionHost' ) ;
245
+ needRestart = true ;
223
246
}
224
247
}
225
248
catch { }
0 commit comments