Skip to content

chore: ask user to reload extension host when configuration changes #5160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions extensions/vscode/src/languageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@ async function activateLc(

watch([enabledHybridMode, enabledTypeScriptPlugin], (newValues, oldValues) => {
if (newValues[0] !== oldValues[0]) {
requestReloadVscode(
`Please reload VSCode to ${newValues[0] ? 'enable' : 'disable'} Hybrid Mode.`
requestRestartExtensionHost(
`Please restart extension host to ${newValues[0] ? 'enable' : 'disable'} Hybrid Mode.`
);
}
else if (newValues[1] !== oldValues[1]) {
requestReloadVscode(
`Please reload VSCode to ${newValues[1] ? 'enable' : 'disable'} Vue TypeScript Plugin.`
requestRestartExtensionHost(
`Please restart extension host to ${newValues[1] ? 'enable' : 'disable'} Vue TypeScript Plugin.`
);
}
});

watch(() => config.server.includeLanguages, () => {
if (enabledHybridMode.value) {
requestReloadVscode(
'Please reload VSCode to apply the new language settings.'
requestRestartExtensionHost(
'Please restart extension host to apply the new language settings.'
);
}
});
Expand Down Expand Up @@ -125,13 +125,13 @@ async function activateLc(
useHybridModeStatusItem();
useInsidersStatusItem(context);

async function requestReloadVscode(msg: string) {
async function requestRestartExtensionHost(msg: string) {
const reload = await vscode.window.showInformationMessage(
msg,
'Reload Window'
'Restart Extension Host'
);
if (reload) {
executeCommand('workbench.action.reloadWindow');
executeCommand('workbench.action.restartExtensionHost');
}
}
}
Expand Down
Loading