Skip to content

Commit 2133b87

Browse files
authored
Remove walkthrough experiment and update the Help links to point to it (#11191)
1 parent d6370f3 commit 2133b87

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

Extension/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"id": "cppWelcome",
6666
"title": "%c_cpp.walkthrough.title%",
6767
"description": "%c_cpp.walkthrough.description%",
68-
"when": "false",
6968
"steps": [
7069
{
7170
"id": "awaiting.activation.mac",

Extension/src/LanguageServer/client.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ interface ConfigStateReceived {
9494

9595
let displayedSelectCompiler: boolean = false;
9696
let secondPromptCounter: number = 0;
97+
let scanForCompilersDone: boolean = false;
9798

9899
let workspaceDisposables: vscode.Disposable[] = [];
99100
export let workspaceReferences: refs.ReferencesManager;
@@ -942,7 +943,7 @@ export class DefaultClient implements Client {
942943
localize("select.compiler", "Select a compiler to configure for IntelliSense") :
943944
(vscode.workspace.workspaceFolders.length > 1 ?
944945
localize("configure.intelliSense.forFolder", "How would you like to configure IntelliSense for the '{0}' folder?", this.RootFolder.name) :
945-
localize("configure.intelliSense.thisFolder", "How would you like to configure IntelliSense this folder?"));
946+
localize("configure.intelliSense.thisFolder", "How would you like to configure IntelliSense for this folder?"));
946947

947948
const items: IndexableQuickPickItem[] = [];
948949
let isCompilerSection: boolean = false;
@@ -1048,17 +1049,39 @@ export class DefaultClient implements Client {
10481049
}
10491050
if (index === paths.length - 2) {
10501051
action = "help";
1052+
// Because we need to conditionally enable/disable steps to alter their contents,
1053+
// we need to determine which step is actually visible. If the steps change, this
1054+
// logic will need to change to reflect them.
1055+
let step: string = "ms-vscode.cpptools#";
1056+
if (!scanForCompilersDone) {
1057+
step = step + "awaiting.activation.";
1058+
} else if (compilerDefaults?.knownCompilers === undefined || !compilerDefaults.knownCompilers.length) {
1059+
step = step + "no.compilers.found.";
1060+
} else {
1061+
step = step + "verify.compiler.";
1062+
}
10511063
switch (os.platform()) {
10521064
case 'win32':
1053-
void vscode.commands.executeCommand('vscode.open', "https://go.microsoft.com/fwlink/?linkid=2217614");
1054-
return;
1065+
step = step + "windows";
1066+
break;
10551067
case 'darwin':
1056-
void vscode.commands.executeCommand('vscode.open', "https://go.microsoft.com/fwlink/?linkid=2217706");
1057-
return;
1068+
step = step + "mac";
1069+
break;
10581070
default: // Linux
1059-
void vscode.commands.executeCommand('vscode.open', "https://go.microsoft.com/fwlink/?linkid=2217615");
1060-
return;
1071+
step = step + "linux";
1072+
break;
10611073
}
1074+
void vscode.commands.executeCommand(
1075+
"workbench.action.openWalkthrough",
1076+
{ category: 'ms-vscode.cpptools#cppWelcome', step },
1077+
false)
1078+
// Run it twice for now because of VS Code bug #187958
1079+
.then(() => vscode.commands.executeCommand(
1080+
"workbench.action.openWalkthrough",
1081+
{ category: 'ms-vscode.cpptools#cppWelcome', step },
1082+
false)
1083+
);
1084+
return;
10621085
}
10631086
const showButtonSender: string = "quickPick";
10641087
if (index === paths.length - 3) {
@@ -2717,6 +2740,7 @@ export class DefaultClient implements Client {
27172740
newTrustedCompilerPath: newCompilerPath ?? ""
27182741
};
27192742
const results: configs.CompilerDefaults = await this.languageClient.sendRequest(QueryCompilerDefaultsRequest, params);
2743+
scanForCompilersDone = true;
27202744
void vscode.commands.executeCommand('setContext', 'cpptools.scanForCompilersDone', true);
27212745
void vscode.commands.executeCommand('setContext', 'cpptools.scanForCompilersEmpty', results.knownCompilers === undefined || !results.knownCompilers.length);
27222746
void vscode.commands.executeCommand('setContext', 'cpptools.trustedCompilerFound', results.trustedCompilerFound);

0 commit comments

Comments
 (0)