Skip to content

Commit

Permalink
Remove walkthrough experiment and update the Help links to point to it (
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbrow authored Jul 18, 2023
1 parent d6370f3 commit 2133b87
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
1 change: 0 additions & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"id": "cppWelcome",
"title": "%c_cpp.walkthrough.title%",
"description": "%c_cpp.walkthrough.description%",
"when": "false",
"steps": [
{
"id": "awaiting.activation.mac",
Expand Down
38 changes: 31 additions & 7 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ interface ConfigStateReceived {

let displayedSelectCompiler: boolean = false;
let secondPromptCounter: number = 0;
let scanForCompilersDone: boolean = false;

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

const items: IndexableQuickPickItem[] = [];
let isCompilerSection: boolean = false;
Expand Down Expand Up @@ -1048,17 +1049,39 @@ export class DefaultClient implements Client {
}
if (index === paths.length - 2) {
action = "help";
// Because we need to conditionally enable/disable steps to alter their contents,
// we need to determine which step is actually visible. If the steps change, this
// logic will need to change to reflect them.
let step: string = "ms-vscode.cpptools#";
if (!scanForCompilersDone) {
step = step + "awaiting.activation.";
} else if (compilerDefaults?.knownCompilers === undefined || !compilerDefaults.knownCompilers.length) {
step = step + "no.compilers.found.";
} else {
step = step + "verify.compiler.";
}
switch (os.platform()) {
case 'win32':
void vscode.commands.executeCommand('vscode.open', "https://go.microsoft.com/fwlink/?linkid=2217614");
return;
step = step + "windows";
break;
case 'darwin':
void vscode.commands.executeCommand('vscode.open', "https://go.microsoft.com/fwlink/?linkid=2217706");
return;
step = step + "mac";
break;
default: // Linux
void vscode.commands.executeCommand('vscode.open', "https://go.microsoft.com/fwlink/?linkid=2217615");
return;
step = step + "linux";
break;
}
void vscode.commands.executeCommand(
"workbench.action.openWalkthrough",
{ category: 'ms-vscode.cpptools#cppWelcome', step },
false)
// Run it twice for now because of VS Code bug #187958
.then(() => vscode.commands.executeCommand(
"workbench.action.openWalkthrough",
{ category: 'ms-vscode.cpptools#cppWelcome', step },
false)
);
return;
}
const showButtonSender: string = "quickPick";
if (index === paths.length - 3) {
Expand Down Expand Up @@ -2717,6 +2740,7 @@ export class DefaultClient implements Client {
newTrustedCompilerPath: newCompilerPath ?? ""
};
const results: configs.CompilerDefaults = await this.languageClient.sendRequest(QueryCompilerDefaultsRequest, params);
scanForCompilersDone = true;
void vscode.commands.executeCommand('setContext', 'cpptools.scanForCompilersDone', true);
void vscode.commands.executeCommand('setContext', 'cpptools.scanForCompilersEmpty', results.knownCompilers === undefined || !results.knownCompilers.length);
void vscode.commands.executeCommand('setContext', 'cpptools.trustedCompilerFound', results.trustedCompilerFound);
Expand Down

0 comments on commit 2133b87

Please sign in to comment.