Skip to content

Commit ff4cdc8

Browse files
authored
Fix to display updateChannel deprecation messages when using VS Code Insiders (#8655)
1 parent b4c1b9d commit ff4cdc8

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

Extension/src/main.ts

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -138,37 +138,34 @@ export function HandleInsidersPrompt(): void {
138138
// Only display this prompt to users who have updateChannel configured for Insiders,
139139
// and who are not already configured to receive pre-release extensions.
140140

141-
// Skip the prompt if using an Insiders build of VS Code, as it will default to using pre-release extensions.
142-
if (!util.isVsCodeInsiders()) {
143-
const targetPopulation: TargetPopulation = util.getCppToolsTargetPopulation();
144-
// Skip the prompt if already using an insiders build of cpptools.
145-
if (targetPopulation === TargetPopulation.Public) {
146-
const settings: CppSettings = new CppSettings();
147-
const displayedInsidersPrompt: PersistentState<boolean> = new PersistentState<boolean>("CPP.displayedInsidersPrompt", false);
148-
// Skip the prompt if updateChannel was not set to Insiders.
149-
if (settings.updateChannel === "Insiders") {
150-
if (!displayedInsidersPrompt.Value) {
151-
displayedInsidersPrompt.Value = true;
152-
const message: string = localize('updateChannel.changed', "The `C_Cpp.updateChannel` setting is deprecated. Do you want to enable install of pre-releases of the C/C++ extension via the Marketplace?");
153-
const yes: string = localize("yes.button", "Yes");
154-
const no: string = localize("no.button", "No");
155-
vscode.window.showInformationMessage(message, yes, no).then((selection) => {
156-
switch (selection) {
157-
case yes:
158-
vscode.commands.executeCommand("workbench.extensions.installExtension", "ms-vscode.cpptools", { installPreReleaseVersion: true });
159-
break;
160-
case no:
161-
break;
162-
default:
163-
break;
164-
}
165-
});
166-
}
167-
} else {
168-
// Reset persistent value, so we prompt again if they switch to "Insiders" again.
169-
if (displayedInsidersPrompt.Value) {
170-
displayedInsidersPrompt.Value = false;
171-
}
141+
const targetPopulation: TargetPopulation = util.getCppToolsTargetPopulation();
142+
// Skip the prompt if already using an insiders build of cpptools.
143+
if (targetPopulation === TargetPopulation.Public) {
144+
const settings: CppSettings = new CppSettings();
145+
const displayedInsidersPrompt: PersistentState<boolean> = new PersistentState<boolean>("CPP.displayedInsidersPrompt", false);
146+
// Skip the prompt if updateChannel was not set to Insiders.
147+
if (settings.updateChannel === "Insiders") {
148+
if (!displayedInsidersPrompt.Value) {
149+
displayedInsidersPrompt.Value = true;
150+
const message: string = localize('updateChannel.changed', "The `C_Cpp.updateChannel` setting is deprecated. Do you want to enable install of pre-releases of the C/C++ extension via the Marketplace?");
151+
const yes: string = localize("yes.button", "Yes");
152+
const no: string = localize("no.button", "No");
153+
vscode.window.showInformationMessage(message, yes, no).then((selection) => {
154+
switch (selection) {
155+
case yes:
156+
vscode.commands.executeCommand("workbench.extensions.installExtension", "ms-vscode.cpptools", { installPreReleaseVersion: true });
157+
break;
158+
case no:
159+
break;
160+
default:
161+
break;
162+
}
163+
});
164+
}
165+
} else {
166+
// Reset persistent value, so we prompt again if they switch to "Insiders" again.
167+
if (displayedInsidersPrompt.Value) {
168+
displayedInsidersPrompt.Value = false;
172169
}
173170
}
174171
}

0 commit comments

Comments
 (0)