@@ -18,6 +18,8 @@ import * as vscode from 'vscode';
1818import { config } from './lib/config' ;
1919import { activate as activateWelcome } from './lib/welcome' ;
2020
21+ let needRestart = false ;
22+
2123const incompatibleExtensionIds = [
2224'johnsoncodehk.vscode-typescript-vue-plugin' ,
2325'Vue.vscode-typescript-vue-plugin' ,
@@ -64,6 +66,27 @@ export const { activate, deactivate } = defineExtension(async () => {
6466
6567nextTick ( ( ) => stop ( ) ) ;
6668
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+
6790watch ( ( ) => config . server . includeLanguages , async ( ) => {
6891const reload = await vscode . window . showInformationMessage (
6992'Please restart extension host to apply the new language settings.' ,
@@ -219,7 +242,7 @@ try {
219242}
220243
221244if ( tsExtension . isActive ) {
222- vscode . commands . executeCommand ( 'workbench.action.restartExtensionHost' ) ;
245+ needRestart = true ;
223246}
224247}
225248catch { }
0 commit comments