Skip to content

Commit 3a0b8d8

Browse files
committed
prompt user to reload workspace when changing copilot hover option
1 parent 10fb3cf commit 3a0b8d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ export class DefaultClient implements Client {
843843
public lastCustomBrowseConfigurationProviderId: PersistentFolderState<string | undefined> | undefined;
844844
public lastCustomBrowseConfigurationProviderVersion: PersistentFolderState<Version> | undefined;
845845
public currentCaseSensitiveFileSupport: PersistentWorkspaceState<boolean> | undefined;
846+
public currentCopilotHoverEnabled: PersistentWorkspaceState<string> | undefined;
846847
private registeredProviders: PersistentFolderState<string[]> | undefined;
847848

848849
private configStateReceived: ConfigStateReceived = { compilers: false, compileCommands: false, configProviders: undefined, timeout: false };
@@ -1274,6 +1275,7 @@ export class DefaultClient implements Client {
12741275
this.hoverProvider = new HoverProvider(this);
12751276

12761277
const settings: CppSettings = new CppSettings();
1278+
this.currentCopilotHoverEnabled = new PersistentWorkspaceState<string>("cpp.copilotHover", settings.copilotHover);
12771279
if (settings.copilotHover === "enabled" ||
12781280
(settings.copilotHover === "default" && await telemetry.isFlightEnabled("cpp.copilotHover"))) {
12791281
this.copilotHoverProvider = new CopilotHoverProvider(this);
@@ -1471,6 +1473,9 @@ export class DefaultClient implements Client {
14711473
if (this.currentCaseSensitiveFileSupport && workspaceSettings.isCaseSensitiveFileSupportEnabled !== this.currentCaseSensitiveFileSupport.Value) {
14721474
void util.promptForReloadWindowDueToSettingsChange();
14731475
}
1476+
if (this.currentCopilotHoverEnabled && workspaceSettings.copilotHover !== this.currentCopilotHoverEnabled.Value) {
1477+
void util.promptForReloadWindowDueToSettingsChange();
1478+
}
14741479
return {
14751480
filesAssociations: workspaceOtherSettings.filesAssociations,
14761481
workspaceFallbackEncoding: workspaceOtherSettings.filesEncoding,

0 commit comments

Comments
 (0)